Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started