Question: 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

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
Get step-by-step solutions from verified subject matter experts
