1 /**
2 A coin with a monetary value.
3 */
4 public class Coin
5 {
6 private double value;
7 private String name;
8
9 /**
10 Constructs a coin.
11 @param aValue the monetary value of the coin
12 @param aName the name of the coin
13 */
14 public Coin(double aValue, String aName)
15 {
16 value = aValue;
17 name = aName;
18 }
19
20 /**
21 Gets the coin value.
22 @return the value
23 */
24 public double getValue()
25 {
26 return value;
27 }
28
29 /**
30 Gets the coin name.
31 @return the name
32 */
33 public String getName()
34 {
35 return name;
36 }
37 }