public class Lunch implements Taxable { private String description; private String model; private BigDecimal price; //etc (more code follows) }
public Lunch(String aDescription, String price) {
this.description = aDescription;
this.price = new BigDecimal(price);
}
public BigDecimal beforeTaxPrice() {
return this.getPrice();
}
package taxcalc.test; import java.math.BigDecimal; import taxcalc.model.Taxable; public class Lunch implements Taxable { private String description; private String model; private BigDecimal price; public Lunch(String aDescription, String price) { this.description = aDescription; this.price = new BigDecimal(price); } public String getDescription() { return description; } public String getModel() { return model; } public BigDecimal getPrice() { return price; } @Override public BigDecimal beforeTaxPrice() { return this.getPrice(); } }