Advertisement
Guest User

Untitled

a guest
Oct 28th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.41 KB | None | 0 0
  1. package tp_3;
  2.  
  3. public class GreenFerryPricing1 extends DefaultFerryPricing {
  4.  
  5.     public GreenFerryPricing1() {
  6.         super();
  7.     }
  8.  
  9.     int computePrice(Vehicle v) {
  10.         return super.computePrice(v);
  11.     }
  12.  
  13.     int computePrice(Car c) {
  14.         if (c instanceof ElectricCar) {
  15.             return super.computePrice(c) / 2;
  16.         }
  17.         return super.computePrice(c);
  18.     }
  19.  
  20.     int computePrice(Bike b); {
  21.         return super.computePrice(b);
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement