Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java Question. Write a program that checks to see if the user won the lottery. Assume the winning lottery numbers are 5 43 35 17

Java Question.

Write a program that checks to see if the user won the lottery. Assume the winning lottery numbers are 5 43 35 17 23. Ask the user for five numbers and compare those numbers to the winning numbers to determine how many matches the user got. In a lottery, the order of the numbers doesn't matter. The numbers must be between 1-99. Do not show the number the user inputs, just ask for the numbers.

Required Output:

Check your lottery numbers here! Enter number 1: Enter number 2: Enter number 3: Enter number 4: Enter number 5: All set. The winning numbers were: 5 43 35 17 23 Well, you didn't win. You got 0 matching number(s) 

Check your lottery numbers here! Enter number 1: Enter number 2: Enter number 3: Enter number 4: Enter number 5: All set. The winning numbers were: 5 43 35 17 23 WOW! You are winner! 

Check your lottery numbers here! Enter number 1: Enter number 2: Enter number 3: Must be between 1 and 99 Enter number 3: Must be between 1 and 99 Enter number 3: Must be between 1 and 99 Enter number 3: Must be between 1 and 99 Enter number 3: Must be between 1 and 99 Enter number 3: Enter number 4: Must be between 1 and 99 Enter number 4: Enter number 5: All set. The winning numbers were: 5 43 35 17 23 Well, you didn't win. You got 3 matching number(s) 

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

Fundamentals Of Database Systems

Authors: Ramez Elmasri, Shamkant B. Navathe

7th Edition Global Edition

1292097612, 978-1292097619

More Books

Students also viewed these Databases questions

Question

What are the Five Phases of SDLC? Explain each briefly.

Answered: 1 week ago

Question

How can Change Control Procedures manage Project Creep?

Answered: 1 week ago