Question: a C++ program that mimics a calculator. The program should take as input two integers and the operation to be performed. Sample user inputs: 3

a C++ program that mimics a calculator.

The program should take as input two integers and the operation to be performed.

Sample user inputs:

3 + 4

10 - 5

2 * 4

4 / 2

It should then output the numbers, the operator, and the result. (For division, if the denominator is zero, output an appropriate message: "Cannot divide by zero")

Sample outputs:

3 + 4 = 7

10 - 5 = 5

2 * 4 = 8

4 / 2 = 2

***Use switch statement for operators (+, -, *, /). If the user types a different operator, prompt the user: "Illegal Operation", and terminate the program.)

OUTPUT:

**********************************************************************

Enter two integer numbers with an arithmetic operator (ex. 3 + 4): 3 + 4

3 + 4 = 7

**********************************************************************

Enter two integer numbers with an arithmetic operator (ex. 3 + 4): 10 - 5

10 - 5 = 5

**********************************************************************

Enter two integer numbers with an arithmetic operator (ex. 3 + 4): 2 * 4

2 * 4 = 8

**********************************************************************

Enter two integer numbers with an arithmetic operator (ex. 3 + 4): 4 / 2

4 / 2 = 2

**********************************************************************

Enter two integer numbers with an arithmetic operator (ex. 3 + 4): 3 % 2

Illegal Operation.

**********************************************************************

Enter two integer numbers with an arithmetic operator (ex. 3 + 4): 3 / 0

Can't divide by 0.

*********************************************************************

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!