Пример #1
0
 /**
  * Class constructor specifying name of make (manufacturer), model, the year the car was made, the car's registration number,
  * it's current odometer reading and it's fuel tank capacity.
  *
  * @param manufacturer
  * @param model
  * @param makeYear
  * @param registrationNumber
  * @param odometerReading
  * @param tankCapacity
  */
 public Vehicle(String Manufacturer, String Model, int MakeYear, String RegistrationNumber, double OdometerReading, int TankCapacity)
 {
     this.Manufacturer       = Manufacturer;
     this.Model              = Model;
     this.MakeYear           = MakeYear;
     this.RegistrationNumber = RegistrationNumber;
     this.OdometerReading    = OdometerReading;
     this.TankCapacity       = TankCapacity;
     Service        = new Service();
     FuelPurchase   = new FuelPurchase();
     Journey        = new Journey();
     CalculatePrice = new CalculatePrice();
 }
Пример #2
0
 /// <summary>
 ///  Adds the distance travelled to the pre-existing odometer reading
 /// </summary>
 /// <param name="KilometersTravelled"></param>
 public void addKilometers(double KilometersTravelled)
 {
     Journey.addKilometers(KilometersTravelled);
     OdometerReading += KilometersTravelled;
 }