Question: write a class called CoinFlip CoinFlip has three static methods display() flipIt() store() the display() method displays the results of the coin flips CoinFlip the
write a class called CoinFlip CoinFlip has three static methods display() flipIt() store() the display() method displays the results of the coin flips CoinFlip the flipIt() method flips the coin uses the Math class method random() Math.random()>.5 if value is over .5 then heads (true) the store() method is a private method stores the result of the coin flips called by the flipit() method CoinFlip contains a class-level private boolean array can be used by all the methods of the class stores the results of 100 coin flips uses at least one for loop and one while loop counts the number of heads and tails displays the total number of heads and tails reports the longest run of heads TestCoinFlip has a main method uses only objects of CoinFlip does not contain any loops nor conditionals
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
