Question: JAVA Part One: Get Valid Lottery Details ( 8 points ) Ask the user how many lottery tickets were sold and how many unique winning

JAVA Part One: Get Valid Lottery Details (8 points)
Ask the user how many lottery tickets were sold and how many unique winning numbers there should be.
The minimum value for both the number of tickets and the number of winners is 1. In other words, you cannot have 0 or fewer tickets or winners.
The number of unique winners cannot be greater than the number of tickets sold. For example, if the user sold 10 tickets, there cannot be 11 winners.
Use loop(s) to repeatedly to ask for the lottery details until you receive valid values that pass both of these tests.
Part Two: Generate Unique Random Winning Numbers (12 points)
Tickets start at number 1. For example, if the user sold 500 tickets, the tickets are numbered from 1 to 500. Your program will randomly generate unique winning numbers from within the range of ticket numbers.
From main, invoke the first method described below and save the returned array in a variable. Then output the winning number array to the user.

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 Programming Questions!