Lottery Write a program which accepts a series of lottery number inputs from the user and determines how much the user won. PROGRAM DESIGN The program should be able to accept a series of lottery numbers from the user. Lottery numbers should be unique and have no duplicates. Solve this problem using loops and sequences. There should be six (6) unique lottery numbers involved. If the user entered six numbers, these numbers should be compared to a set containing the winning sequence of numbers – the number ordering doesn’t matter in the comparison. For each winning number, 100 pesos is won by the user. The winning set of numbers is { 10, 11, 8, 1, 5, 20 }. INPUT The input consists of a single line input that contains 1.) the name of the user, 2.) six numbers separated by spaces. The name of the user is a string. The six subsequent numbers should be typecasted as integers later in the code. OUTPUT Once the user enters the input, the program should be able to traverse through the numbers and determine how many winning numbers the user has betted on / entered. The user should enter 6 numbers. If the total number of numbers exceeds 6 or is less than 6, the error message “Should be 6 numbers” should be displayed. Otherwise, If the user won at least one winning number the message “User won prizemoney pesos!” – where User is the name of the user, and prizemoney is the total winning numbers times 100. If the user did not win any winning number, the message “User won nothing!” should be displayed instead. Please note that all entered numbers must be unique – with no duplicates. If duplicates were encountered, the error message “No Duplicates” should be displayed. SAMPLE INPUT Ely 1 8 10 27 12 15  Buddy 1 8 27 3 4 9 Raims 9 4 3 12 15 21 Makoy 1 1 8 10 27 15 Nitoy 1 Jugs 1 1 1 1 1 1 1 SAMPLE OUTPUT Ely won 300 pesos! Buddy won 200 pesos! Raims won nothing! No Duplicates Should be 6 numbers Should be 6 numbers

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter6: Modularity Using Functions
Section6.4: A Case Study: Rectangular To Polar Coordinate Conversion
Problem 9E: (Numerical) Write a program that tests the effectiveness of the rand() library function. Start by...
icon
Related questions
Question
100%

Lottery

Write a program which accepts a series of lottery number inputs from the user and determines how much the user won.

PROGRAM DESIGN

The program should be able to accept a series of lottery numbers from the user. Lottery numbers should be unique and have no duplicates. Solve this problem using loops and sequences. There should be six (6) unique lottery numbers involved. If the user entered six numbers, these numbers should be compared to a set containing the winning sequence of numbers – the number ordering doesn’t matter in the comparison. For each winning number, 100 pesos is won by the user. The winning set of numbers is { 10, 11, 8, 1, 5, 20 }.

INPUT

The input consists of a single line input that contains 1.) the name of the user, 2.) six numbers separated by spaces. The name of the user is a string. The six subsequent numbers should be typecasted as integers later in the code.

OUTPUT

Once the user enters the input, the program should be able to traverse through the numbers and determine how many winning numbers the user has betted on / entered. The user should enter 6 numbers.
If the total number of numbers exceeds 6 or is less than 6, the error message “Should be 6 numbers” should be displayed. Otherwise, If the user won at least one winning number the message “User won prizemoney pesos!” – where User is the name of the user, and prizemoney is the total winning numbers times 100. If the user did not win any winning number, the message “User won nothing!” should be displayed instead. Please note that all entered numbers must be unique – with no duplicates. If duplicates
were encountered, the error message “No Duplicates” should be displayed.

SAMPLE INPUT

Ely 1 8 10 27 12 15 
Buddy 1 8 27 3 4 9
Raims 9 4 3 12 15 21
Makoy 1 1 8 10 27 15
Nitoy 1
Jugs 1 1 1 1 1 1 1

SAMPLE OUTPUT

Ely won 300 pesos!
Buddy won 200 pesos!
Raims won nothing!
No Duplicates
Should be 6 numbers
Should be 6 numbers

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Program on Numbers
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++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
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