Question: Write a Java program that prompts the user to enter a mathematical operation as input ( e . g . , 7 + 9

Write a Java program that prompts the user to enter a mathematical operation as input (e.g.,"7+9") and outputs the result of the operation. The program should:
1. Take a mathematical operation as one string (one input).
2. Read the first number and second number and convert them from String to
double using Double.parseDouble(numberAsString).
3. Your program should have one (switch) statement.
4. Use only Selections, Mathematical Functions, Characters, Strings and loops
DO NOT USE ARRAYS OR SPLITS AT ALL.

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!