Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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: 3Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started