Question: Write a simple calculator that operates as described here: 1 . The program starts by asking the user for two integers, which are stored in
Write a simple calculator that operates as described here:
The program starts by asking the user for two integers, which are stored in variables
having the type of int.
Program asks whether the user wants to add, subtract, multiply or divide the
numbers.
Next, the calculator will perform the desired operation and output the result.
If the user tries to divide by zero, then the calculator gives an error message "Zero
cannot be used as a divisor." The result of the division operation must be rounded to
two decimal places.
Note: If the user does not select the program prints the text "The operation was not
recognized."
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
