CS103_PA1

A coin toss outcome can be generated using the rand

Info iconThis preview shows page 1. Sign up to view the full content.

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

Unformatted text preview: 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 generated 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. An AND logical operator can be used in conj...
View Full Document

Ask a homework question - tutors are online