subject

Please Help. ( java programming) The FantasyFiveLotto (domain) class simulates 2 tickets, the winning 5-number Fantasy 5 Lottery ticket and the user’s ticket of selected numbers. Include the following:
2 arrays of 5 integers each: fantasyLotteryNumbers and userLotteryPicks.

The constructor that uses the Random class to generate unique random numbers in the range of 1 to 36 for each of the 5 numbers in the fantasyLotteryNumbers array. (Call checkForDuplicates(..) for each number that is randomly generated.)

The method getUsersPicks(), which:0

Prompts the user to enter 5 unique numbers between 1 – 36
which will be stored in the array of integers named usersLotteryPicks
(call checkForDuplicates(..) for each number suggested by the user)

Display the fantasyLotteryNumbers array previously generated in the constructor, as a "cheating mechanism" to test the logic of matching the numbers.

The method checkForDuplicates(int[] anArray, int aNum) which:
Returns a TRUE if aNum already exists in anArray
Returns a FALSE if aNum does NOT exist in anArray
This method will be called from both the constructor and the getUserPicks() methods,
o in a loop that repeats while the method returns a value of TRUE, for each number to be added to an array.

The method checkLotteryMatch(), which will:
Compare the 2 arrays fantasyLotteryNumbers & usersLotteryPicks and return the number of digits that match.

Since the digits do not have to match in the exact order, a nested loop is needed to go through each digit in the user's lottery picks array and compare it to each digit in the fantasyLotteryNumbers array.

A Driver class called the LotteryGame, which instantiates the FantasyFiveLotto class called aFantasyFiveLotto. The driver will call the following methods:
1.) aFantasyFiveLotto. getUsersPicks() method
2.) aFantasyFiveLotto. checkLotteryMatch() method. Use the number returned from the call to the checkLotteryMatch() method to determine if the user/player is a winner by using the following criteria:
• For a 3-digit match, display a message to the user that he/she will receive a free Lottery ticket as the prize
• For a 4-digit match, display a message to the user that he/she will receive a $2000 prize
• For a 5-digit match, display a message to the user that he/she will receive a prize of $50,000.
If there are less than 3 matches, display the following message to the user: "Sorry, no prizes today. Try again!"

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 05:00
Modern businesses use different technologies to accomplish work tasks
Answers: 2
question
Computers and Technology, 22.06.2019 17:40
Gabe wants to move text from one document to another document. he should copy the text, paste the text, and open the new document highlight the text, select the cut command, move to the new document, make sure the cursor is in the correct location, and select the paste command select the save as command, navigate to the new document, and click save highlight the text, open the new document, and press ctrl and v
Answers: 1
question
Computers and Technology, 24.06.2019 02:50
Be sure to answer all parts. synthesize the following compound from benzene. a. b. c. d. e. f. reaction [1] conditions: a b c d e f reaction [1] product: draw structure reaction [2] conditions: a b c d e f reaction [2] product: draw structure reaction [3] conditions: a b c d e f reaction [3] product:
Answers: 3
question
Computers and Technology, 24.06.2019 15:30
What is not a type of text format that will automatically be converted by outlook into a hyperlink?
Answers: 1
You know the right answer?
Please Help. ( java programming) The FantasyFiveLotto (domain) class simulates 2 tickets, the winni...
Questions
Questions on the website: 13722359