Question: please.solve my java question Problem #2: (30 pts) Write a program that prompts the user to enter two numbers a and b and an arithmetic

 please.solve my java question Problem #2: (30 pts) Write a program

please.solve my java question

Problem #2: (30 pts) Write a program that prompts the user to enter two numbers a and b and an arithmetic operator op where op can be * or /. The program then computes the result of a op b. The program should take into account the following cases: If the user enters an invalid operator, the program displays the error message "Invalid operator!". If the user enters the division operator"/" and the denominator bis 0, the program displays the error message "Division by 0 is not allowed!". Sample run 1: Enter two numbers: 15 2 Enter one of the operators (*, 7): / 15.0 / 2.0 = 7.5 Sample run 2 : Enter two numbers: 12 8 Enter one of the operators (*. /): + Invalid operator! Sample run 3: Enter two numbers: 70 Enter one of the operators (*. /): / Division by O is not allowed

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!