Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Craps is a dice-based game played in many casinos. Like blackjack, a player plays against the house. The game starts with the player throwing a

Craps is a dice-based game played in many casinos. Like blackjack, a player plays against the house. The game starts with the player throwing a pair of standard, six-sided die. If the player rolls a total of 7 or 11 in the first round, the player wins. If the player rolls a total of 2, 3, or 12 in the first round, the player loses. For all other roll values, the player must roll again to determine whether he/she has won or lost. In the second and subsequent rounds the player rolls the pair of dice again. If the player matches the roll value 2/27/2018 Assignment 9 -- CSC 241-801 file:///Users/bmaya/Documents/DePaul_Teaching/17-18_WQ/csc241W2017Hws/assign9.html 3/5 from the first round again, he/she wins. If the player rolls a 7, he/she loses. Play continues into another round until the initial roll is matched (for a win) or a 7 is rolled (for a loss).

image text in transcribed

in python plz, screenshot of code helps with indentations

c. Finally, implement a function testCraps0 that takes a positive integer n as a parameter, simulates n games of craps using the quietCraps0 function, and returns the fraction of games the player won The function must call the quietCraps function. Any solution that duplicates code found in the quietCraps0 function will not earn full credit. The following shows several sample runs of the Python 3.6.2 Shell File Edit Shel Debug Options Window Help >>n-testcCraps (100) 0.52 >n -testCraps (100) 0.49 >>> n = testCraps (1000) 0.485 >>>ntestcraps (10000) 0.4899 >>> n = testcraps (100000) > n 0.49438 Ln: 162 Col: 4

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_2

Step: 3

blur-text-image_3

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

Select Healthcare Classification Systems And Databases

Authors: Katherine S. Rowell, Ann Cutrell

1st Edition

0615909760, 978-0615909769

More Books

Students also viewed these Databases questions