Question: * * Write a calculator program. The program should ask the user to input two operands and an operation sign (+, or/). The program

* * Write a calculator program. The program should ask the user to input two operands and an operation sign (+, or/). The program should print the result of performing the required operation on the input operands. The program should display the error message "Error: invalid operation" if the user enters any operation other than (+, -, or /). The program should also display the error message "Error: division by zero" if operand 2 is 0 for the division operation /. Enter operand 1: 5 Enter operand 2: 10 Enter operation: The result of 5/10 is 0.5 Figure 2: Sample run of Exercise 2
Step by Step Solution
There are 3 Steps involved in it
Here is a Java program that acts as a simple calculator according to the specified requirements java ... View full answer
Get step-by-step solutions from verified subject matter experts
