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, 21.06.2019 19:30
Why is it a good idea to leave an interview being courteous and polite?
Answers: 1
question
Computers and Technology, 21.06.2019 23:30
Show that there is a language a ⚆ {0, 1} â— with the following properties: 1. for all x â a, |x| ≤ 5. 2. no dfa with fewer than 9 states recognizes a. hint: you don’t have to define a explicitly; just show that it has to exist. count the number of languages satisfying (1) and the number of dfas satisfying (2), and argue that there aren’t enough dfas to recognize all those languages. to count the number of languages satisfying (1), think about writing down all the strings of length at most 5, and then to define such a language, you have to make a binary decision for each string about whether to include it in the language or not. how many ways are there to make these choices? to count the number of dfas satisfying (2), consider that a dfa behaves identically even if you rename all the states, so you can assume without loss of generality that any dfa with k states has the state set {q1, q2, . . , qk}. now think about how to count how many ways there are to choose the other four parts of the dfa.
Answers: 3
question
Computers and Technology, 24.06.2019 11:00
In three to five sentences, describe how you can organize written information logically and sequentially
Answers: 1
question
Computers and Technology, 24.06.2019 11:20
Every telecommunication setup uses two devices: one device to transmit data and one device to receive data. which device transmits frequencies to mobile phones? towers transmit frequencies to mobile phones.
Answers: 1
You know the right answer?
Please Help. ( java programming) The FantasyFiveLotto (domain) class simulates 2 tickets, the winni...
Questions
question
Biology, 25.06.2019 22:20
question
English, 25.06.2019 22:20
Questions on the website: 13722367