Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In JAVA, create a lottery game application. Generate three random numbers, each between 0 and 9. Allow the user to guess three numbers. Compare each

In JAVA, create a lottery game application. Generate three random numbers, each between 0 and 9. Allow the user to guess three numbers. Compare each of the user's guess to the three random numbers and display a message that includes the user's guess, the randomly determined three-digit number, and the amount of money the user has won as follows:

matching numbers award ($)
any one matching 10
two matching 100
three matching not in order 1,000
three matching in exact order 1,000,000
no matches 0

make certain that your application accommodates repeating digits. For example, if a user guesses 1,2, and 3, and the randomly generated digits are 1,1, and 1, do not give the user credit for three correct guesses - just one. Save the file as Lottery.java.

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

Databases Organizing Information Digital And Information Literacy

Authors: Greg Roza

1st Edition

1448805929, 978-1448805921

More Books

Students also viewed these Databases questions

Question

5. If yes, then why?

Answered: 1 week ago

Question

3. What changes should I be making?

Answered: 1 week ago