CPP Week 14
From IAMMediaWiki Create Change
Homework
- Prepare for Final Exam
- Complete Final Projects
- Complete all assignments
Labs
FINAL EXAM REVIEW
Modify your midterm craps program as follows:
Play 1000 games of craps and keep track of statistics to answer the following questions.
- How many games are won on the 1st, 2nd, 3rd, … 20th roll, and any after the 20th roll.
- How many games are lost on the 1st, 2nd, 3rd, … 20th roll, and any after the 20th roll.
- What are the chances of winning at craps? [total number of wins/total number of games]
- What is the average length of a game of craps? [total number of rolls for all games/total number of games ]?
Sample Output
