Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Important notes: 1-by using java 2-by using switch i need the answer, thank you all in advance Lab Exercise: Write a Java application based on

Important notes:
1-by using java
2-by using switch
i need the answer, thank you all in advance image text in transcribed
image text in transcribed
Lab Exercise: Write a Java application based on the given flowchart in Figure 2. The application generates two integer numbers. The first one is in the range from 1 to 10 and the second one is selected randomly from the set . Then, it displays a menu of the following choices: 1. Addition 2. Subtraction 3. Multiplication 4. Division (the second integer should not equal to zero). Assume integer division. 5. Compare the two numbers (determine if the first integer is larger, smaller or equal to the second integer) The application should read the user choice and display the output. Sample Output #1 The two numbers that are generated randomly are 9 and 4 Choose from the menu: 1 - Addition 2- Subtraction 3- Multiplication 4- Division 5- Comparing two integers Enter your choice: 1 9 + 4 = 13 Sample Output #2 The two numbers that are generated randomly are 7 and 0 Choose from the menu: 1 - Addition 2- Subtraction 3- Multiplication 4- Division 5- Comparing two integers Enter your choice: 4 ERROR: Cannot divide by zero! Sample Output #3 The two numbers that are generated randomly are 3 and 6 Choose from the menu: 1 - Addition 2- Subtraction 3- Multiplication 4- Division 5- Comparing two integers Enter your choice: 5 3

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_2

Step: 3

blur-text-image_3

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

Statistical And Scientific Database Management International Working Conference Ssdbm Rome Italy June 21 23 1988 Proceedings Lncs 339

Authors: Maurizio Rafanelli ,John C. Klensin ,Per Svensson

1st Edition

354050575X, 978-3540505754

More Books

Students also viewed these Databases questions