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.

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

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

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!