Example #1
0
        static void Main(string[] args)
        {
            ElectricCar elCar1 = new ElectricCar("Mahindra", "e2o plus", 4, 230, 135, Consumption.High);
            ElectricCar elCar2 = new ElectricCar("Audi", "Q2 L e-Tron", 2, 250, 100, Consumption.Economic);
            ElectricCar elCar3 = new ElectricCar("Chery", "QQ3", 5, 225, 120, Consumption.Medium);

            FuelCar fuCar1 = new FuelCar("Peugeot", "208 II", 4, 260, 102, 1234, Consumption.Medium, EngineType.Petrol);
            FuelCar fuCar2 = new FuelCar("Mazda", "208 II", 4, 280, 95, 468, Consumption.Economic, EngineType.Diesel);
            FuelCar fuCar3 = new FuelCar("Porsche", "Taycan", 4, 300, 110, 2357, Consumption.High, EngineType.Diesel);


            elCar1.Drive(250);
            elCar2.Drive(234);
            elCar3.Drive(112);
            Console.WriteLine("***********************************************");
            fuCar1.Drive(742);
            fuCar2.Drive(345);
            fuCar3.Drive(532);
            Console.WriteLine("***********************************************");
            elCar1.Recharge(234);
            elCar2.Recharge(112);
            elCar3.Recharge(23);
            Console.WriteLine("***********************************************");
            fuCar1.ReFuel(241);
            fuCar2.ReFuel(236);
            fuCar3.ReFuel(321);
            Console.WriteLine("***********************************************");
            elCar1.PrintInfo();
            elCar2.PrintInfo();
            elCar3.PrintInfo();
            Console.WriteLine("***********************************************");
            fuCar1.PrintInfo();
            fuCar2.PrintInfo();
            fuCar3.PrintInfo();
        }
Example #2
0
        static void Main(string[] args)
        {
            var electricCar = new ElectricCar()
            {
                Brand       = "bmw",
                Model       = 2001,
                Door        = 5,
                TopSpeed    = 150,
                Consumption = Consumption.Medium
            };

            electricCar.PrintInfo();
            electricCar.Drive(200);
            electricCar.Recharge(300);

            var fuelCar = new FuelCar()
            {
                Brand       = "Open",
                Model       = 2005,
                Door        = 4,
                TopSpeed    = 200,
                Consumption = Consumption.High
            };

            fuelCar.PrintInfo();
            fuelCar.Drive(300);
            fuelCar.Refuel(40);
        }
        static void Main(string[] args)
        {
            var newCar = new Car()
            {
                CarBrand      = "Audi",
                CarModel      = "A6",
                NumberOfDoors = 4,
                TopSpeed      = 260,
                Consumption   = Consumption.Economic,
                EngineType    = EngineType.Diesel,
                CarId         = CarIDGenerator.GenerateID()
            };

            newCar.PrintInfo();
            newCar.Drive(10);

            var newFuelCar = new FuelCar()
            {
                CarBrand      = "Toyota",
                CarModel      = "Corrola",
                NumberOfDoors = 5,
                TopSpeed      = 260,
                Consumption   = Consumption.Medium,
                EngineType    = EngineType.Diesel,
                CarId         = CarIDGenerator.GenerateID()
            };

            newFuelCar.PrintInfo();
            newFuelCar.Drive(1000);
            newFuelCar.Refuel(100);
        }
        static void Main(string[] args)
        {
            Console.WriteLine("Electric Car");

            var tesla = new ElectricCar("Tesla", "Newest", 5, 220, Enums.Consumption.economic, Enums.EngineType.electric, 100, 80);


            tesla.PrintInfo();
            tesla.Drive(150);
            tesla.Recharge(300);

            Console.WriteLine();


            Console.WriteLine("Fuel Car");

            var astonMartin = new FuelCar()
            {
                Brand              = "Aston Martin",
                Model              = "DBS Superleggera",
                Doors              = 3,
                TopSpeed           = 280,
                levelOfConsumption = Enums.Consumption.high,
                TypeOfEngine       = Enums.EngineType.petrol,
                FuelCapacity       = 80,
                CurrentFuel        = 60,
            };

            astonMartin.PrintInfo();
            astonMartin.Drive(1500);
            astonMartin.Refuel(40);

            Console.ReadLine();
        }
Example #5
0
        static void Main(string[] args)
        {
            ElectricCar Car1 = new ElectricCar(10, "prv", "prv", 3, 200, Consumption.medium, 100, 50);
            FuelCar     Car2 = new FuelCar(50, "vtor", "vtor", 5, 220, Consumption.high, EngineType.diesel, 200, 160);

            Car1.PrintInfo();
            Car2.PrintInfo();
            Car1.Drive(100);
            Car1.Drive(400);
            Car1.Recharge(60);
            Car1.Recharge(50);
            Car2.Drive(200);
            Car2.Drive(600);
            Car2.Refuel(130);
            Car2.Refuel(130);
            Car1.PrintInfo();
            Car2.PrintInfo();
        }
Example #6
0
        static void Main(string[] args)
        {
            ElectricCar nissan = new ElectricCar("Nissan", "Leaf", 5, 220, Consumption.Econimic, EngineType.Electric, 100, 59);


            nissan.PrintInfo();
            nissan.Drive(572);
            nissan.Recharge(2059);
            Console.ReadLine();

            FuelCar honda = new FuelCar("Honda", "Civic - Type R", 4, 230, Consumption.Medium, EngineType.Petrol, 60, 49);

            honda.PrintInfo();
            honda.Drive(195);
            honda.Refuel(9);
            Console.ReadLine();
        }
Example #7
0
        static void Main(string[] args)
        {
            int id = 0;

            ElectricCar electricCar = new ElectricCar(id, "mazda", "navajo", 5, 150, Consumption.High, 100, 30);

            Console.WriteLine(electricCar.PrintInfo());
            electricCar.Drive(1200);
            electricCar.Recharge(85);

            Console.WriteLine("-----------------------------------------------");

            FuelCar fuelCar = new FuelCar(id, "porsche", "panamera", 2, 220, Consumption.Economic, EngineType.Diesel, 100, 30);

            Console.WriteLine(fuelCar.PrintInfo());
            fuelCar.Drive(1680);
            fuelCar.Refuel(62);
        }
Example #8
0
        static void Main(string[] args)

        {
            var electricCar1 = new ElectricCar()
            {
                BateryCapacity = 100,
                Consume        = Consumption.economic,
                BatteryLeft    = 100,
                ID             = CarIdGenerator.GenerateCarId(),
                Brand          = "Toyota",
                Model          = "Prius",
                Doors          = 5,
                TopSpeed       = 180
            };

            electricCar1.PrintInfo();
            electricCar1.Drive(900);
            electricCar1.Recharge(900);


            var fuelCar1 = new FuelCar()
            {
                FuelCapacity = 60,
                Consume      = Consumption.medium,
                CurrentFuel  = 60,
                Brand        = "KIA",
                Model        = "Ceed",
                Doors        = 5,
                ID           = CarIdGenerator.GenerateCarId(),
                TopSpeed     = 190,
            };

            fuelCar1.PrintInfo();
            fuelCar1.Drive(310);
            fuelCar1.Refuel(10);



            Console.ReadLine();
        }
Example #9
0
        static void Main(string[] args)
        {
            var idNumber = RandomNumber.GenerateRandomNum();
            var toyota   = new FuelCar()
            {
                Brand        = "Toyota",
                Model        = "C-HR",
                Doors        = 2,
                TopSpeed     = 190,
                Id           = idNumber,
                FuelCapacity = 50,
                CurrentFuel  = 30
            };

            toyota.TypeOfEngine = EngineType.Disel;
            toyota.Consumpt     = Consumption.Medium;

            toyota.PrintInfo();

            toyota.Drive(30);
            toyota.Refuel(45);


            var nissan1 = new ElectricCar()
            {
                Brand           = "Nissan",
                Model           = "Leaf",
                Doors           = 5,
                TopSpeed        = 144,
                Id              = idNumber + 1,
                BatteryCapacity = 243,
                BatteryUsage    = 40
            };

            nissan1.TypeOfEngine = EngineType.Electric;
            nissan1.Consumpt     = Consumption.Economic;

            nissan1.PrintInfo();
            nissan1.Drive(40);
            nissan1.Recharge(10);


            var audi = new FuelCar()
            {
                Brand        = "Audi",
                Model        = "A 7",
                Doors        = 4,
                TopSpeed     = 250,
                Id           = idNumber + 2,
                FuelCapacity = 65,
                CurrentFuel  = 50
            };

            audi.TypeOfEngine = EngineType.Petrol;
            audi.Consumpt     = Consumption.Hight;

            audi.PrintInfo();

            audi.Drive(180);
            audi.Refuel(20);
            Console.ReadLine();
        }