yah I just realized I f*ed up the whole thing anyway so here's the revised version
one quick question before starting- what integer can I use to represent a function (+ - * /)? Every time I don't know what integer to use is put (?)
here you go:
#include <iostream>
using namespace std;
int main()
{
int answer;
char function;
int a;
int b;
(need integer type here)
cout<<"Hello and welcome to A+ Super Calculator, letting you run functions that normal calculators can't!";
cout<<"***Please enter first number in equation.";
cin>> a;
cin.ignore();
cout<<"Please enter second number.";
cin>> b;
cin.ignore();
cout<<"Please enter a function.";
cin>> function;
cin>> (?)
if ( (?) == + ) {
cout<< a+b
}
else if ( (?) == - ) {
cout<< a-b;
}
else if ( (?) == * ) {
cout<< a*b;
}
else if ( (?) == / ) {
cout<< a/b;
}
}
I will make C++ my bitch.
|