How can I earn money with StudyBay Top writers
Order Assignment
This order has already been completed on Studybay
On Studybay you can order your academic assignment from one of our 45000 professional writers. Hire your writer directly, without overpaying for agencies and affiliates! Check price for your assignment
15 total offers received. Writer hired: ProfessorA

Write an interactive program

Write an interactive program using a while loop to play a coin-tossing game as long as the user wishes to continue. Ask the user if he/she would like to pay $4 to toss a coin. As long as the user says yes, the game continues. Use a random number generator to produce the head or tail result on the coin toss, and ask the user to guess if the coin is heads or tails. If the guess is correct, pay the user $6. If the guess is incorrect, pay nothing. If the user chooses to quit, then print a message showing how much money the user has. A screenshot has been attached showing the process of a number of coin tosses. See the following resources for using random numbers: https://docs.python.org/3/library/random.html#random.randint http://askpython.com/exercise-2-2-random-numbers/
Write an interactive program using a while loop to play a coin-tossing game as long as the user wishes to continue. Ask the user if he/she would like to pay $4 to toss a coin. As long as the user says yes, the game continues. Use a random number generator to produce the head or tail result on the coin toss, and ask the user to guess if the coin is heads or tails.
Related Materials
Assignment ID
62344
CREATED ON
15 November 2016
COMPLETED ON
16 November 2016
Price
$40
This order has already been completed on Studybay
On Studybay you can order your academic assignment from one of our 45000 professional writers. Hire your writer directly, without overpaying for agencies and affiliates!
Check price for your Other types
Latest reviews for ProfessorA
hanin
19 October 2017
hanin
super good good thank u so much ......... 5/5 on time
aliamh912
15 October 2017
aliamh912
good job!
hanin
14 October 2017
hanin
good work thank you so much on time