Question: Suppose you want to develop a program to play a lottery. The program randomly generates a three - digit number, prompts the user to enter

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:1. If the users input matches the lottery in the exact order, the award is $10,000.2. If all the digits in the users input match all the digits in the lottery number, the award is $3,000.3. If one digit in the users 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 users guess#print the lottery number# Check the guess and print the result
Use idle shell

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!