You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
474 B
27 lines
474 B
|
|
public class CoinInventory {
|
|
private int[] coinCounts; //cp (pennies), sp (dimes), ep (half-dollars), gp (dollar bills), pp (five dollar bills)
|
|
private int weight; //The weight is the sum of all the coins.
|
|
|
|
public CoinInventory() {
|
|
coinCounts = new int[5];
|
|
}
|
|
|
|
public void setCoins(int[] a) {
|
|
coinCounts = a;
|
|
}
|
|
|
|
public int[] getCoins() {
|
|
return coinCounts;
|
|
}
|
|
|
|
public void setWeight(int w) {
|
|
weight = w;
|
|
}
|
|
|
|
public int getWeight() {
|
|
return weight;
|
|
}
|
|
|
|
}
|