Question: Write in C++ using for loop. I can't seem to figure this out. Please help me out, leave comments next to the codes so I
Write in C++ using for loop.
I can't seem to figure this out. Please help me out, leave comments next to the codes so I know whats going on
A coin is tossed repeatedly, and a payoff of 2n dollars is made, where n is the number of the toss on which the first Head appears. So TTH pays $8, TH pays $4 and H pays $2. Write a program to simulate playing the game 10 times. Display the result of the tosses and the payoff. At the end, display the average payoff for the games played. A typical run would be: TTTH You win $16.00 TH TH You win $4.00 You win $4.00 You win $2.00 TTTTHYou win $32.00 TH You win $4.00 You win $2.00 You win $2.00 You win $4.00 You win $4.00 TH TH The average payout was $7.40
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
