Author Topic: trying to make a trig program......  (Read 2594 times)

Offline sweldon001

  • Single posting newcomer
  • *
  • Posts: 2
trying to make a trig program......
« on: February 07, 2019, 12:53:00 am »
what am I coding wrong with a menu?
Code
#include <iostream>
#include <stdio.h>

using namespace std;

int main(int argc, char *argv[])
{
    cout << "Hello Welcome to trig 101!" << endl;
    cout << "Please select of the following :" << endl;
    cout << "1. AsinWt " << endl;
    cout << "2. BcosWt " << endl;
    cout << "3. CtanWt " << endl;
    int getchar(1,2,3,4); int getchar (5,6,7,8);
    if char(1){
    float a,b,c,d; float e,f,g;
    cout << " Please enter Angel A: " << endl; cin >> a;
    cout << " Please enter Adjacent Angel a : " << endl; cin >> b;
    cout << "Please enter Hypotenuse : " << endl; cin >> c;
    cout << " Please enter Time in Military seconds :" << endl; cin >> d;
    e = (1/d); f = (b/c); g = a*(f*d)*e;
    cout << " your answer is :" << g;
    };
    else {};
    if char(2){
            float a,b,c,d; float e,f,g;
    cout << " Please enter Angel B: " << endl; cin >> a;
    cout << " Please enter Opposite Angel a : " << endl; cin >> b;
    cout << "Please enter Hypotenuse : " << endl; cin >> c;
    cout << " Please enter Time in Military seconds :" << endl; cin >> d;
    e = (1/d); f = (b/c); g = a*(f*d)*e;
    cout << " your answer is :" << g;
    };
    else {};
    if char (3){
        float a,b,c,d; float e,f,g;
    cout << " Please enter Angel C: " << endl; cin >> a;
    cout << " Please enter Adjacent Angel a : " << endl; cin >> b;
    cout << "Please enter Opposite Angel c : " << endl; cin >> c;
    cout << " Please enter Time in Military seconds :" << endl; cin >> d;
    e = (1/d); f = (b/c); g = a*(f*d)*e;
    cout << " your answer is :" << g;
    };
    else {};

    return 0;
}

Offline sweldon001

  • Single posting newcomer
  • *
  • Posts: 2
Re: trying to make a trig program......
« Reply #1 on: February 07, 2019, 12:57:21 am »
why doesn't getchar (1,2,3,4,) have to be int ? and why on earth wont it grab those char to function ?

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: trying to make a trig program......
« Reply #2 on: February 07, 2019, 02:05:24 am »
totally wrong forum for this kind of question...
You probably should learn the basics in c before you ask this question somewhere else, because your code has nothing to do with c ...
This for sure does not compile...