Page 1 of 1

Please create a java program that allows the user to create a fake lottery game and see how many tickets they need to bu

Posted: Thu Jul 14, 2022 2:12 pm
by answerhappygod
Please create a java program that allows the user to create afake lottery game and see how many tickets they need to buy to geta jackpot.
Ask the user to enter the total # of numbers that will be usedin the ticket, ensure the value is between 3 and 10
Ask the user to enter the max value for the numbers in theticket, ensure it is less than 100
Create a class for LottoTicket that has an arrayList of integersfor the numbers.
Add a constructor that accepts values for numberOfValues andmaxValue
Add the numberOfValues of random numbers 1 to maxValue (including max value ) to the arraylist of integers
add a method isWinner that accepts an instance of LottoTicket (not the values themselves, but another instance of the LottoTicketclass ), and return true if all of the values in the ticket matchall of the numbers in the array list of values ( remember, don'tjust compare the two arrays with == to see if they match, thatwon't work ).