(Solved) : Write Program Acts Simple Calculator Ask User Enter Two Integers Ask Operator List User En Q44043588 . . .
Programming language is C++
Write a program that acts as a simple calculator. • Ask the user to enter two integers. • Then ask for an operator from the list *,/,%,+, and – If the user does not enter a valid operator, report an error and terminate. If the user asks to do division and the second number is zero, you will report an error and terminate. • Otherwise, you will display the equation and the result. Example Output Enter two integers: 35 Enter an operator from the list */% +- 3*5 = 15 Enter two integers: 50 Enter an operator from the list */%+- You cannot divide by zero. Enter two integers: 20 12 Enter an operator from the list */% + – & That is not a valid operator. Show transcribed image text Write a program that acts as a simple calculator. • Ask the user to enter two integers. • Then ask for an operator from the list *,/,%,+, and – If the user does not enter a valid operator, report an error and terminate. If the user asks to do division and the second number is zero, you will report an error and terminate. • Otherwise, you will display the equation and the result. Example Output Enter two integers: 35 Enter an operator from the list */% +- 3*5 = 15 Enter two integers: 50 Enter an operator from the list */%+- You cannot divide by zero. Enter two integers: 20 12 Enter an operator from the list */% + – & That is not a valid operator.
Expert Answer
Answer to Write a program that acts as a simple calculator. • Ask the user to enter two integers. • Then ask for an operator f…
OR