subject

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:

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 01:00
Program description: a c# app is to be created to produce morse code. the morse code assigns a series of dots and dashes to each letter of the alphabet, each digit, and a few special characters (such as period, comma, colon, and semicolon). in sound-oriented systems, the dot represents a short sound and the dash represents a long sound. separation between words is indicated by a space, or, quite simply, the absence of a dot or dash. in a sound-oriented system, a space is indicated by a short period of time during which no sound is transmitted. the international version of the morse code is stored in the data file morse.txt.
Answers: 3
question
Computers and Technology, 22.06.2019 02:00
Aisha has finished working on a word processing document that contains 15 pages. she has added some special elements in the first three pages, page 9 and 10, and page 15 from the document. she wants to print only these pages to see how they look. which option is the correct way to represent (in the print dialog box) the pages that aisha wants to print?
Answers: 1
question
Computers and Technology, 22.06.2019 23:30
For her science class, elaine is creating a presentation on weather in the united states. she wants to make the presentation beautiful and interesting by drawing simple cloud or wave shapes. which is the best way for elaine to draw these shapes?
Answers: 1
question
Computers and Technology, 23.06.2019 07:00
To produce a starlight effect in her photograph, lina should choose the filter for her camera.
Answers: 1
You know the right answer?
A coin is tossed repeatedly, and a payoff of 2n dollars is made, where n is the number of the toss o...
Questions
question
English, 27.07.2021 01:10
question
Mathematics, 27.07.2021 01:10
question
Mathematics, 27.07.2021 01:10
Questions on the website: 13722367