Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In Java Repetition statements or each person, the program should generate: o 3 numbers for the pick 3 lotto game o 4 numbers for the
In Java
or each person, the program should generate: o 3 numbers for the "pick 3" lotto game o 4 numbers for the "pick 4" lotto game and o 6 numbers for the "pick 6" lotto game . Each call to the method int r = rand . nextInt (9); will generate one lotto value between 0 and 9 (inclusive). : As the numbers are chosen, they should be displayed to the screen immediately. In order to format the output correctly, you will need to print a few blank spaces after the third and seventh number generated, as well as and new line character after the thirteenth number generated for each person. (HINT: How can you use a conditional statement to determine whether you have just completed printing the last Pick 3, Pick 4 or Pick 6 lottery number?) The output should have the following format: For how many people would you like to generate lottery numbers? 2 Your lucky lottery numbers for the day are: Pick 3 1 3 7 1 0 5 Pick 4 8 5 2 4 3 1 2 1 Pick 6 2 6 5 6 62 7 1 1 4 2 1 Test your program to be sure that it works properly. (Note the generated values will vary.) Repetition statements
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started