Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is Python Write a program that generates a lottery of a three-digit number. The program prompts the user to enter a three-digit number and

This is Pythonimage text in transcribed

Write a program that generates a lottery of a three-digit number. The program prompts the user to enter a three-digit number and determines whether the user wins according to the following rules: a. If the user input matches the lottery number in the exact order, the award is $10,000. b. If all digits in the user input match all digits in the lottery number, the award is $3,000. c. If one digit in the user input matches a digit in the lottery number, the award is $1,000. Here are sample runs: Enter your lottery pick (three digits): 591 Lottery is 248 Sorry, no match Enter your lottery pick (three digits): 987 Lottery is 637 Match one digit: you win $1,000 Enter your lottery pick (three digits): 683 Lottery is 836 Match all digits: you win $3,000 Enter your lottery pick (three digits): 494 Lottery is 494 Exact match: you win $10,000

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

Database Management An Organizational Perspective

Authors: Richard T. Watson

1st Edition

0471305340, 978-0471305347

More Books

Students also viewed these Databases questions