Write a program that checks to see if the user won the lottery. Assume the winning lottery numbers are 8, 13, 27, 53, and 54. 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. Test Case 6 Check your lottery numbers here!\n Enter number 1:\n 13ENTER Enter number 2:\n 53ENTER Enter number 3:\n 54ENTER Enter number 4:\n 27ENTER Enter number 5:\n 8ENTER All set. The winning numbers were: 8 13 27 53 54\n WOW! Grand prize winner!\n Test Case 7 Check your lottery numbers here!\n Enter number 1:\n 13ENTER Enter number 2:\n 53ENTER Enter number 3:\n 540ENTER Must be between 1 and 99\n Enter number 3:\n 54ENTER Enter number 4:\n 27ENTER Enter number 5:\n 89ENTER All set. The winning numbers were: 8 13 27 53 54\n Well, you didn't win. You got 4 matching number(s)\n

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter5: Control Structures Ii (repetition)
Section: Chapter Questions
Problem 15PE
icon
Related questions
Question

Write a program that checks to see if the user won the lottery. Assume the winning lottery numbers are 8, 13, 27, 53, and 54. 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.

Test Case 6

 
Check your lottery numbers here!\n
Enter number 1:\n
13ENTER
Enter number 2:\n
53ENTER
Enter number 3:\n
54ENTER
Enter number 4:\n
27ENTER
Enter number 5:\n
8ENTER
All set. The winning numbers were: 8 13 27 53 54\n
WOW! Grand prize winner!\n

Test Case 7

 
Check your lottery numbers here!\n
Enter number 1:\n
13ENTER
Enter number 2:\n
53ENTER
Enter number 3:\n
540ENTER
Must be between 1 and 99\n
Enter number 3:\n
54ENTER
Enter number 4:\n
27ENTER
Enter number 5:\n
89ENTER
All set. The winning numbers were: 8 13 27 53 54\n
Well, you didn't win. You got 4 matching number(s)\n
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Constants and Variables
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
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,