Skip to content

Commit 663084c

Browse files
committed
adding coin changes from second day of code club, coins have values now
1 parent 0f067e6 commit 663084c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/vending/Coin.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11

22
public enum Coin {
3-
QUARTER, DIME, NICKEL, PENNY;
3+
QUARTER(0.25), DIME(0.1), NICKEL(0.05), PENNY(0.01);
4+
private double value;
5+
Coin(double value) {
6+
this.value = value;
7+
}
8+
public Double getValue() {
9+
return value;
10+
}
411
}

0 commit comments

Comments
 (0)