Question: (Using VS17Express) Write a C++ program that mimics a calculator. The program should take as input two integers and the operation to be performed. The

(Using VS17Express)

Write a C++ program that mimics a calculator. The program should take as input two integers and the operation to be performed. The operator should be read as a char variable. It should then output the numbers, the operator and the result. For division and the mod operator, if the denominator is zero, output an error message. Assume the first number is the numerator and the second is the denominator for division operations. Your program should do the following operations: + (plus), - (minus), * (multiplication), / (division), and the % (mod operator for the remainder).

You can also implement a few other functions. Square root (use the r symbol), absolute value (use the a symbol), and/or the reciprocal function (use the p symbol).

Some sample outputs follow:

Enter the first number:

5

Enter the second number:

6

Enter the operator:

+

Your result is:

5+6=11

Thank you for using my calculator.

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!