Question: 1. Create a menu that prompts the student for the type of math problem they would like to solve. See menu below. Welcome to


1. Create a menu that prompts the student for the type of math problem they would like to solve. See menu below. Welcome to the Math Program 1. Addition 2. Subtraction 3. Multiplication 4. Division Enter your choice: 2. Next, using the Scanner class, retrieve the number of the menu choice that was entered by the student. If the student does not enter 1,2,3,4 print an error message and stop the program. a. Don't forget to import java.util.Scanner; 3. Using a random number generator, generate two single-digit integers (between 0 and 9, inclusive). You have a couple of options to do this. i. ii. Random class: 1. To use: import java.util.Random; 2. To generate a random integer between 1 and 52: Random rand = new Random(); int num = rand.nextInt(52) + 1; Math class: 1. No import needed (included in java.lang so accessible by default) 2. Math.random(). This will generate a double between 0 and 1, so I will have to use arithmetic and explicit casting to obtain a number in the specified interval: int num = (int) (Math.random() *52+1); 4. Next, display the equation and prompt the student for the answer ii. Math class: 1. No import needed (included in java.lang so accessible by default) 2. Math.random(). This will generate a double between 0 and 1, so I will have to use arithmetic and explicit casting to obtain a number in the specified interval: int num = (int) (Math.random() *52+1); 4. Next, display the equation and prompt the student for the answer 5. Check the student's answer and display "Correct" or "Incorrect" depending on whether they got it right or wrong, respectively. a. For division: you may choose to use integer division or round the result of the expression (but be sure to tell the user what you'll do so they know what answer to put in). b. If you choose to compare floating-point values, remember that you cannot use == to test equality with precision like you can with integers.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
