View Single Post
  #3 (permalink)  
Old April 15th, 2007, 08:03 PM
nerdman978 nerdman978 is offline
Registered User
 
Join Date: Apr 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.
Reply With Quote