Question: 1) Roll two six sided dice. 2a) If the sum of the dice are 7 or 11, You win. End game 2b) If the sum

1) Roll two six sided dice.

2a) If the sum of the dice are 7 or 11, You win. End game

2b) If the sum is 2,3 or 12, You lose. End game

2c) If the sum is any other number (lets call it n).

3) Roll the dice again

4a)If the new sum is equal to n. You win. End game

4b) If the new sum is equal to 7. You lose. End game

4c) If the sum is any other number go to line

3. What to do for this lab?

Part1) Write a program the will automatically game one game of craps. Try to break you program up into as many functions as possible (But dont be too silly). Comment all your functions and add a comment block to the start of the program (With your name, date and what the program does) (This is good practice for the assignment)

Part2) Now write a program that will play 1000000 games of craps. Have your program calculate the percentage of games won. Does this number make sense?

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!