Question: Problem Statement Suppose you want to develop a program to play a lottery. The program randomly generates a three - digit number, prompts the user
Problem Statement
Suppose you want to develop a program to play a lottery. The program randomly
generates a threedigit number, prompts the user to enter a threedigit number, and
determines whether the user wins according to the following rules:
If the users input matches the lottery in the exact order, the award is $
If all the digits in the users input match all the digits in the lottery number, the
award is $
If one digit in the users input matches a digit in the lottery number, the award
is $
Note that the digits of a threedigit number may be If a number is less than
we assume the number is preceded by a to form a threedigit number. For
example, number is treated as If the number is less than we assume the
number is preceded by two For example, number is treated as and
number is treated as 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 users guess
#print the lottery number
# Check the guess and print the result
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
