Create a java Program,In this question you are asked to write a lottery game application. Your program must first display a welcome message/banner asking the human player for his/her given name.
Create the following program in java:
Create a java Program,In this question you are asked to write a lottery game application. Your program must first display a welcome message/banner asking the human player for his/her given name.
Generate a random number between 0 and 999, which you are to store in a single variable (int). Allow the user to guess a three digit number between 0 and 999, which you are also to store in a single variable of type int.
Compare the user’s guess to the random number and display a message that includes the user’s name, user’s guess, the randomly determined three-digit number and the amount of money the user has won as follows:
Matching digits Awards
Any one matching. $10
Two matching. $100
Three matching not in order. $1000
Three matching in exact order. $1,000,000
No matches. $0
Make sure that your application accommodates repeated digits. For example if a user guesses 123 and the randomly generated number is 111, do not give the user credit for three correct guesses – just one. On the other hand if the user guesses 121 the user gets credit for 2 correct guesses. Note that the 3 digitnumber can start with a 0 or even 2 zeroes. When displaying these numbers be sure to include the zeroes in the front.
Sample output:
********* welcome to lottery game******
what is your name
Annna
welcome Annna
Enter a three digit number followed by enter key
123
The lotto number was 897
The number u gave was 123
There have been no matches u win $0
![](/static/compass_v2/shared-icons/check-mark.png)
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 5 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Concepts of Database Management](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)