Advertisement
advictoriam

Untitled

Mar 4th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.32 KB | None | 0 0
  1. /**
  2.    Represents a car.
  3. */
  4. public class Car extends Vehicle
  5. {
  6.    public Car(double purchasePrice)
  7.    {
  8.       super(purchasePrice);
  9.    }
  10.  
  11.    @Override
  12.    public double getValue()
  13.    {
  14.       double adjustedValue = super.getValue() - 0.25d * getMileage();
  15.       return (adjustedValue > 0) ? adjustedValue : 0;
  16.    }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement