Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Python The Lottery Commission is planning to hire someone to code a program which can be used to easily determine a winning ticket number and

image text in transcribed
image text in transcribed
image text in transcribed
Python
The Lottery Commission is planning to hire someone to code a program which can be used to easily determine a winning ticket number and amount won. You wish to be considered for the job. In order to demonstrate your programming skills you are to write a small 'sample' program which will: * generate and store a 2- digit lottery number Hint: Using the random module, as shown in lecture, can help here. * the user will then be prompted to enter a 2-digit number. If the user entry is not between 10 and 99, the program is to given an error message Otherwise, the program is to PRINT OUT THE LOTTERY NUMBER and then determine whether the user is a winner according to the following rules: - if the input matches the lottery number in the - if the input matches the lottery number in the exact order, the award is $10,000. - if both digits in the input value occur in the lottery number, but not in the same order, the award is $3,000. - if only one digit in the user input matches a digit in the lottery number, the award is $1,000 - if no digits in the user input occur in the lottery number, award is $0 Hint: You can either work with your numbers in int form, or convert to strings if you find that easier. Be sure that your program is well commented, and has been well tested. Output should be clearly labeled. Five sample runs of the program: Please enter your two digit number56 The winning number was 79 Sorry, better luck next time Please enter your two digit number79 The winning number was 79 You have the winning number, and have won $10,000 Please enter your two digit number97 The winning number was 79 Your numbers are out of order, you have won $3,000 Please enter your two digit number201 Your guess is not a two digit number Please enter your two digit number77 The winning number was 79 One of your digits occurs in the winning number, $1,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 Concepts

Authors: David Kroenke, David Auer, Scott Vandenberg, Robert Yoder

10th Edition

0137916787, 978-0137916788

More Books

Students also viewed these Databases questions

Question

2. KMPG LLP

Answered: 1 week ago

Question

5. Wyeth Pharmaceuticals

Answered: 1 week ago