454,118 Members | 856 Online Need help? Post your question and get tips & solutions from a community of 454,118 IT Pros & Developers. It's quick & easy.

# write a program that will mimic a calculator

 P: 7 please help me.... using selection structure the program should take as input two integers and the operation to be performed, iust as it would be entered into a standard calculator. it should output to the screen the same input, including the operator and the result of the operation. example: input2+2, and output 2+2=4 thank. Mar 12 '07 #1
4 Replies

 Expert Mod 2.5K+ P: 4,677 please help me.... using selection structure the program should take as input two integers and the operation to be performed, iust as it would be entered into a standard calculator. it should output to the screen the same input, including the operator and the result of the operation. example: input2+2, and output 2+2=4 thank. Ok, what do you need help with? Mar 12 '07 #2

 10K+ P: 13,264 please help me.... using selection structure the program should take as input two integers and the operation to be performed, iust as it would be entered into a standard calculator. it should output to the screen the same input, including the operator and the result of the operation. example: input2+2, and output 2+2=4 thank. You may consider using a switch. So what code have you written so far? Mar 12 '07 #3

 P: 7 You may consider using a switch. So what code have you written so far? i only know the flowing. i don't know how to use switch. Expand|Select|Wrap|Line Numbers int answer;     int num1=0;     int num2=0;     char ch = ' ';       cout << "Welcome to the calculator" << endl;     cout << "Enter your equation as number operation number" << endl;     cout << "(Example: 3 + 4): ";       cin>>num1>>ch>>num2;          cout<

 Expert Mod 2.5K+ P: 4,677 i only know the flowing. i don't know how to use switch. Expand|Select|Wrap|Line Numbers int answer;     int num1=0;     int num2=0;     char ch = ' ';       cout << "Welcome to the calculator" << endl;     cout << "Enter your equation as number operation number" << endl;     cout << "(Example: 3 + 4): ";       cin>>num1>>ch>>num2;          cout< 