how to write java program that simulates flipping a coin 100 times (head/tail needs to be generated
Question:
how to write java program that simulates flipping a coin 100 times (head/tail needs to be generated randomly all 100 times) and display the total number of heads and tails at the end. Sample Output-1: Assume you are generating 5 random flips (tail, tail, tail, head, tail} Note - This is just an assumption for sample output. In your code you need to generate 100 times Result: Total number of Heads = 1 Total numner of Tails = 4 Sample Output-2: Assume you are generating 10 random flips {tail, tail, tail, head, tail, head, head, head, head, head} Note - This is just an assumption for sample output. In your code you need to generate 100 times Result: Total number of Heads = 6 Total numner of Tails = 4
John E Freunds Mathematical Statistics With Applications
ISBN: 9780134995373
8th Edition
Authors: Irwin Miller, Marylees Miller