Question: Create program in java. Must be done in mutiple methods. Use random class, int arrays. Write a program to simulate a lottery game. Generate a
Create program in java. Must be done in mutiple methods. Use random class, int arrays.


Write a program to simulate a lottery game. Generate a random 10 digit number and then prompt the user to enter a 10 digit number. Both numbers should be stored in an array where each element of the array is one digit of the number. The total jackpot is $100,000. You should compare the user's guess to the randomly generated lottery number and give the user a percentage of the winnings based on how many digits they guessed correctly. For example: if the winning number is 5936577294 and the user guesses 5473077294 they would get 60% of the winnings since they guessed 6/10 numbers correctly. A digit in the user's number is correct if it matches the corresponding number in the same digit position as the winning number. NOTE: To get credit for this problem you must store each number in an array as described above, and use these arrays to complete the assignment. Sample Output: Enter a 10 digit lottery number: 5473077294 Winning Number: 0456180747 User Guess: 5473077294
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
