Question: Write a Java program that will meet the following system requirements: 1. Prompts the user to choose 3 numbers that he thinks will be the

Write a Java program that will meet the following system requirements: 1. Prompts the user to choose 3 numbers that he thinks will be the lottery numbers (between 0 and 100, 100 is not included). 2. Lets the user know which inputs are invalid. 3. Uses a loop to allow the user to input new values until all values are integers and those integers are in range. 4. Stores the numbers in 3 integer variables: num1, num2, num3. 5. Uses a loop that will simulate a lottery commission choosing 3 random numbers. This loop will continue to run until the 3 numbers that the user chose gets selected. This loop will keep track of how many iterations it took for the loop to generate those 3 numbers. 6. Output the number of iterations it took for the program to generate those numbers. Notes: 1. The Lottery Commission will compute numbers in multiples of 3 during each iteration. 2. This exercise can be completed using either Console Input / Output or a JOptionPane GUI.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!