Your program will generate a 5-digit lottery number and


Write a basic java program called that simulates a lottery.
Your program will generate a 5-digit lottery number, and then it will prompt the user to enter a guess in the form of a 5-digit number. Your program should then determine how many numbers the user guessed correctly and the user's prize. Your program must use an object of the Random class to generate five integers in the range 0 through 9 and must store these integers in an array.Your program also needs to prompt the user to enter 5 integers in the range 0 through 9 and then needs to store these integers in an array. So you will use two integer arrays in this program.To determine how many numbers the user correctly guessed, your program needs to compare corresponding elements of both arrays in a for loop. Use a counter variable to keep track of how many numbers the user guessed correctly. At the end of the program, output to the user the lottery number, the user's guess, and the number of that the user guessed correctly.Finally, your program needs to determine and display the user's prize. Here is a chart that defines the prizes for this lottery:

Number of

correct digits              Prize
0                                $0
1                                $10
2                               $100
3                                $1,000
4                                $10,000
5                               $100,000

 

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: Your program will generate a 5-digit lottery number and
Reference No:- TGS0644845

Expected delivery within 24 Hours