Question: Using idle shell At the top of your program include comments: CPSC 1 4 0 Mod 4 A 1 Your Name The Date You should

Using idle shell
At the top of your program include comments:
CPSC140 Mod4A1
Your Name
The Date
You should save the program as
Mod4A1_YourLastName.py
Problem Statement
Suppose you want to develop a program to play a lottery.
The program randomly generates a three-digit number,
prompts the user to enter a three-digit number, and
determines whether the user wins according to the
following rules:
If the user's input matches the lottery in the exact
order, the award is $10,000.
If all the digits in the user's input match all the digits in
the lottery number, the award is $3,000.
If one digit in the user's input matches a digit in the
lottery number, the award is $1,000.
Note that the digits of a three-digit number may be 0. If a
number is less than 100, we assume the number is
preceded by a 0 to form a three-digit number. For
example, number 80 is treated as 080. If the number is
less than 10, we assume the number is preceded by two
00. For example, number 5 is treated as 005 and number
0 is treated as 000 in the program.
The basic outline of your program should be:
# Generate a lottery number
# Prompt the user to enter a guess
# Get digits from lottery number
# Get digits from user's guess
#print the lottery number
# Check the guess and print the result
Using idle shell At the top of your program

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!