Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions