Write a java program that simulates the flipping of a coin


Write a Java program that simulates the flipping of a coin 1000 times and prints the total number of heads and tails. You must create a class called Coin with the following public methods: 

void flip(): flips the coin (Hint: Math.random() generates a random floating-point number between 0 and 1.)
boolean isHeads(): returns true if the coin shows heads
String toString(): returns the current face of the coin as a string

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: Write a java program that simulates the flipping of a coin
Reference No:- TGS0141057

Expected delivery within 24 Hours