Line 28: the line is unfinished.
Line 29: that bracket shouldn't exist.
Lines 13, 31, 49 and 67: those while loops do not make any sense. I think what you want to do is execute some code only on a certain condition. In that case you must use "if":
Ok I got it to run but it is using random math i.e addition, subtraction, multiplication, and division all at the same time. you never know what its going to be.
Thank you all for the help!
Heres my code now
for addition you should have if (n==1)
for subtraction you should have if (n==2)
for multiplication you should have if (n==3)
for division you should have if (n==4)
it'll be better if you use "else if" statements or switch / case statements.
Oh wow... now i feel stupid haha!
Thank you!
Edit: Now it only says "Enter First Number: Plus:" all 1 line and when i try to type something and click enter it closes.
Awesome thanks everyone, It works perfectly now, but how could i get it to rerun it self after it solves an equation so i could keep typing new equations instead of it just ending after it displays the first Answer.
For instance:
Addition: 1 Subtraction: 2 Multiplication: 3 Division: 4 1
Enter First Number: 3
Plus: 4
Total: 7
Addition: 1 Subtraction: 2 Multiplication: 3 Division: 4
bool Quit = false;
int Option = 1;
while (!Quit) {
//get input
//switch statement here
switch (Option) {
case 1:
//addition stuff here
break;
case 2:
//Subtraction
break;
case 3:
//Multiplication
break;
case 4:
//Division
break;
case 5: //user wants to quit
Quit = truebreak;
default: //bad input
std::cout << "Bad Input try again" << std::endl;
} //end of switch
}//end of while loop
Notice with some forms of the do loop, the conditional appears twice.