Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class CarpetCost {
- // Other variables are unused, so I dropped them.
- private double labourCharge;
- public CarpetCost(double cost) {
- this.labourCharge = cost
- }
- // Good practice to make getters for private values, if applicable.
- public double getCost() {
- return this.labourCharge;
- }
- public boolean isDiscount() {
- // Don't need any if statements as the value we're looking for is the expression to find it.
- return this.labourCharge <= 100;
- }
- }
Add Comment
Please, Sign In to add comment