Question: Basic Python Programming 3 test runs for each question Use Control Statements (if and loops) that's it 1. Lottery program. The program randomly generates a
Basic Python Programming
3 test runs for each question
Use Control Statements (if and loops) that's it
1. Lottery program. The program randomly generates a two-digit number, prompts the user to enter a single two-digit number, and determines whether the user wins according to the following rules. Write a loop to let the user play as many times as the user wanted. Use a sentinel or flag to quit out of the loop. You must pick the correct loop for this question. Each time the user continues to play, the program will generate a new two-digit random number until the user enters -999 to quit.
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.
Sample Run(blue user input) Since this is a random number program, if you use the same input as my sample run it will not produce the same results, therefore, use your own input values for your 5 test runs.
Test Run 1
>>>
Enter your lottery pick ( 2 digits) or -999 to quit: 44
Sorry no match
Enter your lottery pick ( 2 digits) or -999 to quit: 23
Match one digit: You win $1,000
Enter your lottery pick ( 2 digits) or -999 to quit: 68
Match one digit: You win $1,000
Enter your lottery pick ( 2 digits) or -999 to quit: 12
Match all digits : You win $3,000
Enter your lottery pick ( 2 digits) or -999 to quit: 45
Exact match: You win $10,000!
Enter your lottery pick ( 2 digits) or -999 to quit: -999
>>>
Provide your own test runs 2, 3, 4, 5.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
