sameFlip

Category: Programming
Author: Helene Martin and Marty Stepp
Book Chapter: 5.1
Problem: sameFlip
Write a static method named sameFlip that accepts a Random object as a parameter. Your method should flip a coin until the same result occurs twice in a row. In other words, if a head is flipped followed by another head or if a tail is flipped followed by another tail, your method should end. You should use the Random object to give an equal chance to a head or tail appearing. Each time the coin is flipped, print H for heads or T for tails.