Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

For the craps game in the tutorial, the client may want to enter a cash amount to bet for each game. If they bet (

For the craps game in the tutorial, the client may want to enter a cash amount to bet for each game. If they bet (e.g., $5) and win, they receive 2 times their bet ($10); if they lose, the money they bet (e.g., $5) goes to the casino.
If you want to allow a player to bet in this way, what core code additions and changes would need to be implemented in the playMultipleGames function?
a.)
def playMultipleGames(number):
if hasWon:
totalWinnings = totalWinnings + bet
else:
totalWinnings = totalWinnings - bet
# under statistics
print("Total Winnings: ${}".format(totalWinnings))
b.)
def playMultipleGames(number,bet):
if hasWon:
totalWinnings = totalWinnings + bet *2
else:
totalWinnings = totalWinnings - bet
# under statistics
print("Total Winnings: ${}".format(totalWinnings))
c.)
def playMultipleGames(number,bet):
# under initialize
totalWinnings =0
if hasWon:
totalWinnings = totalWinnings + bet *2
else:
totalWinnings = totalWinnings - bet
# under statistics
print("Total Winnings: ${}".format(totalWinnings))
d.)
def playMultipleGames(number):
# under initialize
totalWinnings =0
if hasWon:
totalWinnings = totalWinnings + bet
else:
totalWinnings = totalWinnings - bet
# under statistics
print("Total Winnings: ${}".format(totalWinnings

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

Database In Depth Relational Theory For Practitioners

Authors: C.J. Date

1st Edition

0596100124, 978-0596100124

More Books

Students also viewed these Databases questions

Question

Use Excel to generate five random numbers between 1 and 900.

Answered: 1 week ago

Question

1. Is it a topic you are interested in and know something about?

Answered: 1 week ago