Question: hurry up please Problem #2: (30 pts] Write a program that prompts the user to enter two numbers a and b and an arithmetic operator
![hurry up please Problem #2: (30 pts] Write a program that](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f52d374bf48_92666f52d36d633a.jpg)
hurry up please
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 1. 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 b is 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 (*, /): / 15.0 / 2.0 = 7.5 Sample run 2 : Enter two numbers: 128 Enter one of the operators (*, /): + Invalid operator! Sample run 3: Enter two numbers: 70 Enter one of the operators (*. /): / Division by 0 is not allowed! 3/5
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
