Question: calculator.cpp Write a program that prompts the user to select an arithmetic operator and two numbers. The program will calculate and display the result based
calculator.cpp
Write a program that prompts the user to select an arithmetic operator and two numbers. The program will calculate and display the result based on the selected operator.
Input validation: decide how the program should handle an illegal input for the arithmetic operator selection.
Sample run 1
Enter an operator (+, -, * or /): /
Enter two numbers separate with a space: 25 2
25 / 2 = 12.50
Sample run 2
Enter an operator (+, -, * or /): *
Enter two numbers separate with a space: 9 15
9 * 15 = 135.00
please use C++
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
