Branching Program 2 -- Flipping coins

Problem

In many games, the determination of who gets to start first (e.g. have the ball) is done with a coin toss.  For this tutorial, please write a program in JAVA where the computer will flip a coin and state whether or not your guess was correct.

Sample Program Run:

Upon running the program, you should see the following...  Note: user inputs are between angle brackets <>.

Sample 1:

Please input your guess (1 for heads, 0 for tails):
<1>
You chose heads
The toss was tails
You lose
Sample 2:
Please input your guess (1 for heads, 0 for tails):
<1>
You chose heads
The toss was heads
You win