Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions