Question: In this problem, you will create a function called lottoDraw, that generates a list of six digits, at random, between 1 - 5 0 .

In this problem, you will create a function called lottoDraw, that generates a list of six digits, at random, between 1-50.
Create a second function, lottoPick, that prompts the user to input 6 numbers, each between 1-50. This will be the players pick. Entering q should end the program, printing (well-formatted) the total amount left in the players wallet.
Your program should use a function, compareResults, to compare the random draw to the players pick, and determine how many digits match. Order does not matter; it is the number of matching values that generates rewards. Assigns rewards according to this scheme:
$100,000 if 5 match
$100 if 4 match
$7 if 3 match
$7 if 2 match
$4 if 1 matches
$0 if no match
Each player should start with $10 in their wallet. Each time the game is run, subtract $2 from the players wallet and handle the rewards based on the outcome. Once the players wallet is down to $0, the game ends and the player is notified that they are out of money.
There is no limit to the number of functions you can create to make this game work, but it should, at a minimum, have lottoPick, lottoDraw, compareResults, each passing whichever arguments make sense for your implementation.

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 Databases Questions!