Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- Represents a car.
- */
- public class Car extends Vehicle
- {
- public Car(double purchasePrice)
- {
- super(purchasePrice);
- }
- @Override
- public double getValue()
- {
- double adjustedValue = super.getValue() - 0.25d * getMileage();
- return (adjustedValue > 0) ? adjustedValue : 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement