Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a Program that displays repeatedly a menu as shown in the sample run below. The user can enter 1, 2, 3,4 or 5 for

image text in transcribed
Write a Program that displays repeatedly a menu as shown in the sample run below. The user can enter 1, 2, 3,4 or 5 for choosing addition, subtraction, multiplication, division or exit respectively After an operation is finished and output is displayed the menu is redisplayed, you may choose another operatio Each operation will ask the user for two numbers then calculate and display the answer Handle the division by zero situation, by displaying an Error Message if the user is trying to divide by 0 Write program in JAVA n or enter 5 to exit the program. Main Menu 1 Addition 2: Subtraction 3 Multiplication 4: Division 5: Exit Enter a Choice: 1 Enter number 1: 5 Enter number 2: 4 The Answer is: 9 Main Menu Addition 2: Subtraction 3: Multiplication 4 Division 5: Exit Enter a Choice: 4 Enter number 1: 8 Enter number 2: 0 Impossible to divide by Zero. Main Menu 1 Addition 2: Subtraction 3: Multiplication 4: Division 5: Exit Enter a Choice: 5

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

How We Communicate

Answered: 1 week ago

Question

=+j Explain the essential nature of repatriation.

Answered: 1 week ago