Create the equivalent of a four function calculator the


Program

Create the equivalent of a four function calculator. The program should request the user to enter a number an operator and another number. It should then carry out the specified arithmetical operation: adding, subtracting, multiplying or dividing the two numbers (it should use a switch statement to select the operation). Finally it should display the result.

When it finishes the calculation, the program should ask if the user wants to do another calculation. The response can be 'Y' or 'N'. some sample interaction with the program might look like this.

Enter first number, operator, and second number.10/3
Answer=3.333333
Do another (Y/N)? Y

Enter first number, operator, and second number 12+100
Answer=112
Do another (Y/N)? N

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: Create the equivalent of a four function calculator the
Reference No:- TGS01475432

Now Priced at $10 (50% Discount)

Recommended (90%)

Rated (4.3/5)