Question: Write a program that mimics a calculator. The program will need to accept as input two numeric double values, and accept the operation to be

Write a program that mimics a calculator.

The program will need to accept as input two numeric double values, and accept the operation to be performed as the third input.

The operation to be performed will be input in the form of the character representing the java operator for the operation to be performed (i.e + for addition, - for subtraction, * for multiplication, / for division, or % for modulus). Once the program has read these 3 inputs it will output the numbers, the operator, and the result. (For division, if the denominator is zero, the program will output an appropriate message (e.g. division by zero is an invalid operation).

Some sample output may look as follows:

3 + 4 = 7

13 * 5 = 65

10 / 3 = 3.33333333

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!