The program should ask the buyer to enter six digits and


You are requested to code a lava program to simulate LOTTO.

The program should ask the buyer to enter six digits and should store in an integer array. Six digits should be generated randomly in the range 1 through 20. The digits should be filled in a separate array of size six called lottoDigits.

The program must compare the corresponding elements in the two arrays and count how many digits matched.

Once the user has entered a set of numbers, the program should display the whining digits and the player's digits and tell how many digits matched.

The prizes are as follows Six digits matched - $1000 Five digits matched - $800 Four digits matched - $700 Three digits matched - $500 Two digits matched - $100 One digit matched - $0

Input validation:

Do not accept player inputs less than 1 or greater than 10.

No two or more digits should be the same for lottoDigits and buyer.

438_1.png

Congrats! You have won two digits;yourprize Is $100111

Solution Preview :

Prepared by a verified Expert
JAVA Programming: The program should ask the buyer to enter six digits and
Reference No:- TGS01538149

Now Priced at $25 (50% Discount)

Recommended (97%)

Rated (4.9/5)