Commit 28d88ead by Adam Gerber

decimal format stored once in vending machine

parent 08b37074
......@@ -13,7 +13,7 @@ public class Product {
private String mDesc;
private double mPrice;
private static DecimalFormat sDecimalFormat = new DecimalFormat("$0.00");
// private static DecimalFormat sDecimalFormat = new DecimalFormat("$0.00");
public Product(String desc, double price) {
mDesc = desc;
......@@ -38,7 +38,7 @@ public class Product {
@Override
public String toString() {
return mDesc + " " + sDecimalFormat.format(mPrice);
return mDesc + " " + VendMachine.sDecimalFormat.format(mPrice);
}
}
......@@ -51,7 +51,7 @@ public class VendMachine {
//cash-out
//vend
//show products available
private static DecimalFormat sDecimalFormat = new DecimalFormat("$0.00");
public static DecimalFormat sDecimalFormat = new DecimalFormat("$0.00");
//hold the vending machine's bank
private List<Coin> mBanks;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment