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

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

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Java import javautilRandom public class CoinFlipSimulator public static void mainString args Rand... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!