import tester.*;

interface IVehicle {
  // computes the total revenue of this Vehicle
  double totalRevenue();

  // computes the cost of fully fueling this Vehicle
  double fuelCost();

  // computes the per-passenger profit of this Vehicle
  double perPassengerProfit();

  // produce a String that shows the name and passenger capacity of this Vehicle
  String format();

  // is this IVehicle the same as that one?
  boolean sameVehicle(IVehicle that);
}

class Airplane implements IVehicle {
  String name;
  int passengerCapacity;
  double fare; // per passenger fare
  int fuelCapacity; // gallons of fuel (kerosene @ 1.94/gallon)
  String code; // ICAO type designator
  boolean isWideBody; // twin-aisle aircraft

  Airplane(String name, int passengerCapacity, double fare, int fuelCapacity, String code,
      boolean isWideBody) {
    this.name = name;
    this.passengerCapacity = passengerCapacity;
    this.fare = fare;
    this.fuelCapacity = fuelCapacity;
    this.code = code;
    this.isWideBody = isWideBody;
  }

  // computes the total revenue of operating this Airplane
  public double totalRevenue() {
    return this.passengerCapacity * this.fare;
  }

  // computes the cost of fully fueling this Airplane
  public double fuelCost() {
    return 0;
  }

  // computes the per-passenger profit of this Airplane
  public double perPassengerProfit() {
    return 0;
  }

  // produce a String that shows the name and passenger capacity of this
  // Airplane
  public String format() {
    return null;
  }

  // is this Airplane the same as that IVehicle?
  public boolean sameVehicle(IVehicle that) {
    return false;
  }
}

class Train implements IVehicle {
  String name;
  int passengerCapacity;
  double fare; // per passenger fare
  int fuelCapacity; // gallons of fuel (diesel @ 2.55/gallon)
  int numberOfCars; // cars per trainset
  int gauge; // track gauge in millimeters

  Train(String name, int passengerCapacity, double fare, int fuelCapacity, int numberOfCars,
      int gauge) {
    this.name = name;
    this.passengerCapacity = passengerCapacity;
    this.fare = fare;
    this.fuelCapacity = fuelCapacity;
    this.numberOfCars = numberOfCars;
    this.gauge = gauge;
  }

  // computes the total revenue of operating this Train
  public double totalRevenue() {
    return this.passengerCapacity * this.fare;
  }

  // computes the cost of fully fueling this Train
  public double fuelCost() {
    return 0;
  }

  // computes the per-passenger profit of this Train
  public double perPassengerProfit() {
    return 0;
  }

  // produce a String that shows the name and passenger capacity of this Train
  public String format() {
    return null;
  }

  // is this Train the same as that IVehicle?
  public boolean sameVehicle(IVehicle that) {
    return false;
  }
}

class Bus implements IVehicle {
  String name;
  int passengerCapacity;
  double fare; // per passenger fare
  int fuelCapacity; // gallons of fuel (diesel @ 2.55/gallon)
  int length; // length in feet

  Bus(String name, int passengerCapacity, double fare, int fuelCapacity, int length) {
    this.name = name;
    this.passengerCapacity = passengerCapacity;
    this.fare = fare;
    this.fuelCapacity = fuelCapacity;
    this.length = length;
  }

  // computes the total revenue of operating this Bus
  public double totalRevenue() {
    return this.passengerCapacity * this.fare;
  }

  // computes the cost of fully fueling this Bus
  public double fuelCost() {
    return 0;
  }

  // computes the per-passenger profit of this Bus
  public double perPassengerProfit() {
    return 0;
  }

  // produce a String that shows the name and passenger capacity of this Bus
  public String format() {
    return null;
  }

  // is this Bus the same as that IVehicle?
  public boolean sameVehicle(IVehicle that) {
    return false;
  }
}

class ExamplesVehicle {
  IVehicle dreamliner = new Airplane("Boeing 787", 242, 835.0, 33340, "B788", false);
  IVehicle commuterRail = new Train("MPI HSP46", 500, 11.50, 2000, 6, 1435);
  IVehicle silverLine = new Bus("Neoplan AN460LF", 77, 1.70, 100, 60);

  // testing total revenue method
  boolean testTotalRevenue(Tester t) {
    return t.checkInexact(this.dreamliner.totalRevenue(), 242 * 835.0, .0001)
        && t.checkInexact(this.commuterRail.totalRevenue(), 500 * 11.5, .0001)
        && t.checkInexact(this.silverLine.totalRevenue(), 77 * 1.7, 0.001);
  }
}
