4 matches – 300,000 · 3 matches – 10,000 · 2 matches – 2,000 · 1 match – 20 · 0 match – you lose

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter6: Looping
Section: Chapter Questions
Problem 5GZ
icon
Related questions
Question

Java Programming:

The program randomly generates a lottery of a 6-digit number. The program prompts the user to enter a 6-digit number (6/42), and determines whether the user wins according to the following rules:

· 6 matches - 10,000,000.

· 5 matches – 500,000.

· 4 matches – 300,000

· 3 matches – 10,000

· 2 matches – 2,000

· 1 match – 20

· 0 match – you lose

 

SAMPLE OUTPUT:

 

=============== LET’S PLAY LOTTO GAME ===============

 

Enter 1st bet : 34

Enter 2nd bet : 42

Enter 3rd bet : 12

Enter 4th bet : 20

Enter 5th bet : 7

Enter 6th bet : 28

 

5 numbers matched!

You won 500,000

 

The winning combinations are: 12 7 34 19 42 20

 

Please include these:

• Screenshots of code

• Screenshots of output

• UML Diagram

· Code

 

Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Random Class and its operations
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,