Question: Write a program named Lab11C in C++ that will act as a calculator, allowing the user to type in an equation and calculating the result.

 Write a program named Lab11C in C++ that will act as

Write a program named Lab11C in C++ that will act as a calculator, allowing the user to type in an equation and calculating the result. a. Ask the user to enter 2 integers with a character between them, all separated by spaces. The character should be +,,,l, or % b. Input the 2 numbers and the character oper. (oper will be the operator, but we can't use operator as a variable name because it's a reserved word.) c. Write a switch statement based on oper, that will perform the mathematical operation on the numbers. d. Print the whole equation with the result in the following format: If the user types in 40/5, then the output should be: 40/5=8 (You have worked with output statements enough that you should be able to do this.)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!