public class Car implements Taxable { private String make; private String model; private BigDecimal price; //etc (more code follows) }
public Car(String aMake, String aModel, String aPrice) {
this.make = aMake;
this.model = aModel;
this.price = new BigDecimal(aPrice);
}
public BigDecimal beforeTaxPrice() {
return this.getPrice();
}
package taxcalc.test; import java.math.BigDecimal; import taxcalc.model.Taxable; public class Car implements Taxable { private String make; private String model; private BigDecimal price; public Car(String aMake, String aModel, String aPrice) { this.make = aMake; this.model = aModel; this.price = new BigDecimal(aPrice); } public String getMake() { return make; } public String getModel() { return model; } public BigDecimal getPrice() { return price; } @Override public BigDecimal beforeTaxPrice() { return this.getPrice(); } }