Class Coin

java.lang.Object
   |
   +----Coin

public class Coin
extends java.lang.Object
This class keeps track of a coins name and value.


Constructor Index

 o Coin(String, double)
Creates a coin with given name and value.

Method Index

 o equals(Coin)
Returns true if the coin passed has the same name and value as this coin.
 o getValue()
Returns the value of the coin.
 o toString()
Returns the name of the coin.

Constructors

 o Coin
 public Coin(java.lang.String theName,
             double theValue)
Creates a coin with given name and value.

Parameters:
theName - the name of the coin
theValue - the value of the coin

Methods

 o getValue
 public double getValue()
Returns the value of the coin.

Returns:
returns the value of the coin
 o equals
 public boolean equals(Coin rhs)
Returns true if the coin passed has the same name and value as this coin.

 o toString
 public java.lang.String toString()
Returns the name of the coin.

Returns:
returns the name of the coin
Overrides:
toString in class java.lang.Object