Question: Code in JAVA Use an Array NOT ArrayList Develop a program named Lottery that simulates a lottery. In this lottery 6 integers are randomly drawn
Develop a program named Lottery that simulates a lottery. In this lottery 6 integers are randomly drawn from the possible 1 to 49. Use an array to simulate the selection of winning numbers, and ensure that the 6 selected numbers are unique. Store these winning numbers in an array and display the numbers in ascending order. Your program then asks the user to enter their ticket numbers, checks them against the winning numbers, and then determines if 3 or more numbers match. Inform the user if they have a winning ticket (3 matches or more). Assume that the user will enter 6 valid, unique numbers. Include a method called checkTicket that accepts the list of winning numbers, prompts the user for their selected numbers and returns the number of matches
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
