Write a program in JAVA that displays a menu as shown in the sample run and asks user to two

Write a program in JAVA that displays a menu as shown in the sample run and asks the user for two numbers. You can enter 1, 2, 3, 4, 5, 6 to choose addition, subtraction, multiplication, division, integer division, or remainder. Depending on the operation type, you will evaluate the result of the operation. For a division operation such as number1/number2, you should check number2 so that it is not zero. Your program should be inside a loop and exit the loop whenever you enter 7. Select Operation: 1: Addition 2: Subtraction 3: Multiplication 4: Division 5: Integer Division 6: Remainder 7: Exit Enter a choice: 3 Please enter the first number: 20 Please enter the second number: 10 Result of 20 * 10 = 200 Select Operation: 1: Addition 2: Subtraction 3: Multiplication 4: Division 5: Integer Division 6: Remainder 7: Exit Enter a choice: 1 Please enter the first number: 21 Please enter the second number: 11 Result of 21 + 11 = 32

Write a program in JAVA that displays a menu as shown in the sample run and asks the user for two numbers. You can enter 1, 2, 3, 4, 5, 6 to choose addition, subtraction, multiplication, division, integer division, or remainder. Depending on the operation type, you will evaluate the result of the operation. For a division operation such as number1/number2, you should check number2 so that it is not zero. Your program should be inside a loop and exit the loop whenever you enter 7.


Select Operation:
1: Addition
2: Subtraction
3: Multiplication
4: Division
5: Integer Division
6: Remainder
7: Exit

Enter a choice: 3
Please enter the first number: 20
Please enter the second number: 10

Result of 20 * 10 = 200

Select Operation:
1: Addition
2: Subtraction
3: Multiplication
4: Division
5: Integer Division
6: Remainder
7: Exit

Enter a choice: 1
Please enter the first number: 21
Please enter the second number: 11

Result of 21 + 11 = 32


 
Solved By Verified
Study Co-Pilot All Study Co-Pilots are evaluated by Gotit Pro as an expert in their subject area.

 
Instant
Download

Student review: (6 ratings) 6 out of 6 people found this solution helpful.