Computers and Technology
Computers and Technology, 27.02.2020 17:20, royal6032

Write a program that simulates flipping a coin repeatedly and continues until three consecutive heads. are tossed. At that point, your program should display the total number of coin tips that were made the average number of heads. #1 - Write a function to read in the user's information (name & gender) #2 - Write a function to flip the coin and return a bool (heads = true, tails = false) #3 - Write a function to calculate the average of heads vs. total flips #4 - Write a function to output the results Address male users as Mr. and female users as Ms. HINT: Code one function at a time and test it... then add the loop and re-test. Turn in as a single PDF file-Include three (3) test runs. 1-Output (cut and pasted into a txt file in eclipse) 2- Source Code (printed from eclipse - PROPERLY DOCUMENTED) INPUT/OUTPUT - should be formatted as follows - This represents one possible sample run (Class heading should be also displayed) Welcome to coin toss! Get 3 heads in a row to win! What is your name? Ed Peck What is your gender (m/f): M Try to get 3 heads in a row. Good luck Mr. Ed Peck! Press to flip TAIL Press center> to flip HEAD Press to flip HEAD Press center to flip HEAD Press center> to flip HEAD It took you 6 tosses to get 3 heads in a row. On average you flipped heads 67% of the time

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 19:10, hgdthbgjnb83661
What a backup plan that you have created in a event you encounter a situation
Answers: 2
image
Computers and Technology, 22.06.2019 23:30, ansonhunter8891
What are listed in the vertical columns across the top of the event editor? a. file names b. conditions c. check marks d. action types
Answers: 1
image
Computers and Technology, 23.06.2019 18:30, bsept1018
Report all segments of identity by descent longer than 20 polymorphisms between pairs of individuals in the following cohort of 15 individuals across 49 polymorphisms: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 numeric input 2 points possible (graded) you have 2 attempts to complete the assignment below. for example if the sequence is "bcd", which occurs in "abcdef" , the starting point would be 2 (b), and the finishing point would be 4(d). individuals 7,10 between positions
Answers: 1
image
Computers and Technology, 25.06.2019 03:10, lokiliddel
Write a program to convert a person's height in inches into centimetres #and their weight in stones into kilograms. (1 inch = 2.54 cm and 1 stone = 6.364 kg)
Answers: 1
Do you know the correct answer?
Write a program that simulates flipping a coin repeatedly and continues until three consecutive head...

Questions in other subjects: