/** * A coin with a monetary value and a name */ public class Coin implements Measurable { private double value ; // coin value (e.g. .25) private String name ; // coin name (e.g. "quarter") /** * Creates a coin * @param aValue the monetary value of the coin * @param aName the name of the coin */ public Coin(double value, String name) { this.value = value; this.name = name; } /** * Gets the coin value. * @return the value */ public double getValue() { return value; } /** * Gets the coin name. * @return the name */ public String getName() { return name; } /********************************************************************** * Note to students: method getMeasure (below) implements the abstract* * getMeasure method of the Measurable interface, as required * *********************************************************************/ /** * Gets the measure of this coin * @return the coin's value */ public double getMeasure() { return value; } }