eltony Posted May 12, 2011 Author Share Posted May 12, 2011 every time i tried to compile it i get an error omg it deals with the cout << "please enter the second number ect. i tried so much to figure it out i put up just in case some body out there might have a clue.```#include using namespace std;int main(void){ system("TITLE Calculator"); system("COLOR 2"); char cChar; double dfirstnumber; double dsecondnumber; char cdoagain; do { system("CLS"); cout << "please enter the first number that you would like to use" << endl; cin >> dfirstnumber; cout << "please enter the operation that you would like to complete" << " (+,-,* or /)" << endl; cin >> cChar cout << "please enter the second number you would like to use" << endl; Switch (cChar) { case '+': cout << " The answer is: " << dfirstnumber << " + " << dsecondnumber << " = " << (dfirstnumber + dsencondnumber) << endl; break; case '-': cout << " The answer is: " << dfirstnumber << " - " << desencondnumber << " = " << (dfirstnumber - dsecondnumber) << endl; break; case '*': cout << " The answer is: " << dfirstnumber << " * " << dsencondnumber << " = " << (dfirsnumber * dsencondnumber) << endl; break; case 'x': cout << " The answer is: " << dfirstnumber << " x " << dsencondnumber << " = " (dfirstnumber x dsencondnumber) << endl; break; case 'X': cout << " The answer is: " << dfirstnumber << " X " << dsencondnumber << " = " (dfirstnumber X dsencondnumber) << endl; break; case '/': if(dsecondnumber == 0) { cout << " That is an invalid operation" << endl; )else{ cout << " The answer is: " << dfirstnumber << " x " << dsencondnumber << " = " (dfirstnumber x dsencondnumber) << endl; } break; default: cout << "That is an invalid operation" << endl; break; } cout << "would you like to start again? ( y or n)" << enld; cin >> cDoagain; }while (cDoagain == 'Y' or cDogain == 'y'); system("PAUSE") ; return 0; }``` Link to comment Share on other sites More sharing options...
Admiral Refuge Posted May 13, 2011 Share Posted May 13, 2011 Line 22, missing semicolon. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now