Answered step by step
Verified Expert Solution
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started