Hello.
I am new to C++ programming and im trying to write rhis little calculator program and im getting some errors.
If anyone could help me that would be greatly appreciated!
Here is te code:
Im getting errors on the lines with the "ERROR" commented in.Code:#include <iostream> using namespace std; int main() { int number1 = 0; int number2 = 0; float number3 = 0; int opcheck = 0; string operator1; cout << "Enter a whole number: "; cin >> number1; cout << "Enter another whole number: "; cin >> number2; do { cout << "what type of math would you like done?\nEnter the word in lower case plaese: "; cin >> operator1; if ( operator1 == "addition" ) { number1 + number2 = number3; //ERROR opcheck = 1; } else if ( operator1 == "subtraction" ) { number1 - number2 = number3; //ERROR opcheck = 1; } else if ( operator1 == "division" ) { number1 / number2 = number3; //ERROR opcheck = 1; } else if { operator1 == "multiplication" ) { //ERROR number1 * number2 = number3; opcheck = 1; ) else { cout << "Sorry, I didn't quite understand what you ment...\nRemember, 'add' is not an acceptible responce, but 'addition' is!" << endl; } while ( opcheck == 0 ); system("pause"); } //and for some reason im getting an error on this line but theres nothin on it.
Thank you for the help!!!



LinkBack URL
About LinkBacks


