Question: Write a program to simulate flipping 100 coins. Print out the result of every flip (either Heads or Tails). At the end of the program,



Write a program to simulate flipping 100 coins. Print out the result of every flip (either Heads or Tails). At the end of the program, print out how many heads you flipped, how many tails you flipped, what percentage were heads, and what percentage were tails. Status: Not Submitted 4.3.5: Coin Flips M 2 FILES 4 5 6 7- 1 import java.util.*; 3 - public class Randomizer public static Random theInstance = null; public Randomizer({ 8 } Randomizer.java D CoinFlips.java public static Random getInstance(){ if(the Instance == null){ the Instance = new Random(); } return the Instance; } public static boolean nextBoolean(){ return Randomizer.getInstance() .nextBoolean(); } public static boolean nextBoolean(double probability){ return Randomizer.nextDouble)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
