CS103_PA1

CS103_PA1 - Samuel Joo Crowley CS 103 CS 103 Going Broke...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Samuel’Joo ’ Crowley’ CS-103’ CS’103’ –’ Going’Broke ’ Pre-lab’ 1. The’data’that’needs’to’be’maintained’for’a’single’game ’ includes’an’int’of’the’ initial’number’of’coins,’an’int’of’the’number’of’game’simulations,’a’double’of’ the’fairness’(probability’of’heads),’an’int ’ array’of’size’3’that’holds’the’ number’of’coins’for’the’three’players,’an’int’that’counts’the’turns’after’each’ round’simulation,’and’finally’a’double’that’holds’the’average’number’of’ turns’for’the’Monte’Carlo’simulation. 2. A’coin -toss’outcome’can’be’generate d’using’the’rand()’function’along’with’ the’modulus’function.’rand()%2’would’produce’a’value’of’0’or’1,’and’these’ values’can’be’assigned’to’either’heads’or’tails. 3.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 3

CS103_PA1 - Samuel Joo Crowley CS 103 CS 103 Going Broke...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online