Question: Write a simple java program in a file called calc.java whose main() method prompts the user for an integer number, a String operator and a
Write a simple java program in a file called calc.java whose main() method prompts the user for an integer number, a String operator and a second integer number. Write a method for each operation. The main() method then calls the appropriate operation method based on the operator given. Each operation method takes two integer parameters and displays the result of performing the operation on the two parameters. The operators and the operations they represent are as follows.


CHY. CAWINDOWS1system321cmd.exe Enter equation as number operator number 3 4 Press any key to continue Enter equation as number operator number 3 - 4 Press any key to continue Enter equation as number operator number 3 * 4 3*4=12 Press any key to continue Enter equation as number operator number 3 / 4 Press any key to continue Enter equation as number operator number: 3 % 4 Press any key to continue Enter equation as number operator number 3 > 4 3 4 is false Press any key to continue Enter equation as number operator number 34 34 is false Press any key to continue Enter equation as number operator number: 3
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
