文件Coin.java//*******************************************************************//Coin.javaAuthor:LewisandLoftusRepresentsacoinwithtwosidesthatcanbeflipped.//******...
文件Coin.java
// *******************************************************************
// Coin.java Author: Lewis and Loftus
//
// Represents a coin with two sides that can be flipped.
// *******************************************************************
public class Coin
{
public final int HEADS = 0;
public final int TAILS = 1;
private int face;
// ---------------------------------------------
// Sets up the coin by flipping it initially.
// ---------------------------------------------
public Coin ()
{
flip();
}
// -----------------------------------------------
// Flips the coin by rand