How to do java

Using the Coin class defined in Chapter 5, write a program called FourHeads whose main method flips a coin until it gets four heads in a row. Print the total number of flips needed to get four heads in a row.