예제 #1
0
 public Car(Engine engine, bool satnav, string manufacturer, string model, bool locked, string fueltype)
     : base(engine, satnav, manufacturer, model, locked, fueltype)
 {
     Wheels = 4;
     Gears = 5;
     Engine = engine;
 }
예제 #2
0
 public Hatchback(Engine engine, bool satnav, string manufacturer, string model, bool locked, string fueltype)
     : base(engine, satnav, manufacturer, model, locked, fueltype)
 {
     FuelCapacity = 50;
     AvgMPG = 20;
     TopSpeed = 120;
     Engine = engine;
 }
예제 #3
0
 public Automobile(Engine engine, bool satnav, string manufacturer, string model, bool locked, string fueltype)
 {
     MOT = true;
     SatNav = satnav;
     Manufacturer = manufacturer;
     Model = model;
     Locked = locked;
     FuelType = fueltype;
     Engine = engine;
 }
예제 #4
0
 public Lorry(Engine engine, bool satnav, string manufacturer, string model, bool locked, string fueltype)
     : base(engine, satnav, manufacturer, model, locked, fueltype)
 {
     FuelCapacity = 150;
     AvgMPG = 10;
     Wheels = 6;
     Gears = 6;
     TopSpeed = 120;
     Engine = engine;
 }
예제 #5
0
 public Saloon(Engine engine, bool satnav, string manufacturer, string model, bool locked, string fueltype)
     : base(engine, satnav, manufacturer, model, locked, fueltype)
 {
     FuelCapacity = 70;
     AvgMPG = 30;
     Wheels = 4;
     Gears = 5;
     AlarmCode = "abc12345";
     Engine = engine;
 }
예제 #6
0
        public Program6()
        {
            Engine myHatchbackEngine = new Engine(1400);
            MyHatchback = new Hatchback(myHatchbackEngine, true, "Citroen", "Saxo", true, "petrol");

            Engine mySaloonEngine = new Engine(1800);
            MySaloon = new Saloon(mySaloonEngine, true, "Audi", "A3", true, "diesel");

            Engine myLorryEngine = new Engine(2000);
            MyLorry = new Lorry(myLorryEngine, true, "Mercades", "Actros", true, "petrol");

            Stig myStig = new Stig(MyHatchback);
            myStig.GoDriving(600);
        }