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

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education