Question: FOR JAVA: Summary: Create a lottery game application. Include a menu that allows the user to play more than once, or quit after a game.
FOR JAVA:
Summary:
Create a lottery game application. Include a menu that allows the user to play more than once, or quit after a game. You can either use dialog boxes or text based, up to you.
- The solution file should be named Lottery.java
- Generate four random numbers, each between 0 and 9 (inclusive).
- Allow the user to guess four numbers.
- Compare each of the users guesses to the four random numbers and display a message that includes the users guess, the randomly determined four-digit number, and the amount of points the user has won as follows:
| No matches | 0 points |
| Any one digit matching | 5 points |
| Any two digits matching | 100 points |
| Any three digits matching | 2,000 points |
| All four digits matching | 1,000,000 points |
- Run your program until it works and the output looks nice.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
