Example #1
0
        public static void Main()
        {
            FamilyCar myFamilyCar = new FamilyCar(250, 50);

            myFamilyCar.Drive(3);
            Console.WriteLine(myFamilyCar);

            RaceMotorcycle myRaceMotorcycle = new RaceMotorcycle(20, 10);

            myRaceMotorcycle.Drive(0.5);
            Console.WriteLine(myRaceMotorcycle);

            CrossMotorcycle myCrossMotorCycle = new CrossMotorcycle(15, 20);

            myCrossMotorCycle.Drive(10);
            Console.WriteLine(myCrossMotorCycle);
        }
Example #2
0
        static void Main(string[] args)
        {
            Vehicle         viechele        = new Vehicle(10, 100);
            Motorcycle      motorcycle      = new Motorcycle(10, 100);
            Car             car             = new Car(10, 100);
            RaceMotorcycle  raceMotorcycle  = new RaceMotorcycle(10, 100);
            CrossMotorcycle crossMotorcycle = new CrossMotorcycle(10, 100);
            SportCar        sportcar        = new SportCar(10, 100);
            FamilyCar       familyCar       = new FamilyCar(10, 100);

            viechele.Drive(10);
            car.Drive(10);
            motorcycle.Drive(10);
            raceMotorcycle.Drive(10);
            crossMotorcycle.Drive(10);
            familyCar.Drive(10);
            sportcar.Drive(10);
            Console.WriteLine();
        }
Example #3
0
        static void Main(string[] args)
        {
            Vehicle veh = new Vehicle(45, 10);

            veh.Drive(50);
            Console.WriteLine(veh.Fuel);

            Motorcycle mot = new Motorcycle(45, 10);

            mot.Drive(50);
            Console.WriteLine(mot.Fuel);

            Car car = new Car(45, 10);

            car.Drive(50);
            Console.WriteLine(car.Fuel);

            RaceMotorcycle race = new RaceMotorcycle(45, 10);

            race.Drive(50);
            Console.WriteLine(race.Fuel);

            CrossMotorcycle crossMotor = new CrossMotorcycle(45, 10);

            crossMotor.Drive(50);
            Console.WriteLine(crossMotor.Fuel);

            FamilyCar famcar = new FamilyCar(45, 10);

            famcar.Drive(50);
            Console.WriteLine(famcar.Fuel);

            SportCar sportCar = new SportCar(45, 10);

            sportCar.Drive(50);
            Console.WriteLine(sportCar.Fuel);
        }
Example #4
0
        public static void Main(string[] args)
        {
            var motor = new Motorcycle(100, 2.5);

            motor.Drive(100);
            Console.WriteLine(motor.Fuel); //1.25

            var motorRace = new RaceMotorcycle(50, 10);

            motorRace.Drive(100);
            Console.WriteLine(motorRace.Fuel); //2

            var motorCross = new CrossMotorcycle(50, 2.5);

            motorCross.Drive(100);
            Console.WriteLine(motorCross.Fuel); //1.25

            //Car car = new Car(100, 3);
            //car.Drive(100);
            //Console.WriteLine(car.Fuel);

            var car2 = new FamilyCar(100, 3);

            car2.Drive(100);
            Console.WriteLine(car2.Fuel); //0

            var sportCar = new SportCar(50, 10);

            sportCar.Drive(50);
            Console.WriteLine(sportCar.Fuel); //5

            Car car = new Car(100, 3);

            car.Drive(100);
            Console.WriteLine(car.Fuel); //0
        }