Example #1
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);
        }
Example #2
0
        static void Main(string[] args)
        {
            var electricCar = new ElectricCar()
            {
                Brand          = "i3",
                Model          = "BMW",
                Doors          = 5,
                TopSpeed       = 150,
                CarConsumption = Consumption.Medium
            };

            electricCar.InfoAboutTheCar();
            electricCar.Drive(400);
            electricCar.Recharge(350);

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

            var fuelCar = new FuelCar()
            {
                Brand          = "A4",
                Model          = "Audi",
                Doors          = 5,
                TopSpeed       = 200,
                CarConsumption = Consumption.High
            };

            fuelCar.InfoAboutTheCar();
            fuelCar.Drive(150);
            fuelCar.Refuel(47);
        }
Example #3
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();
        }
        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();
        }
        static void Main(string[] args)
        {
            ElectricCar first  = new ElectricCar("Reno", "Laguna", 5, 260, Consumption.Medium, EngineType.Electric, 500, 300);
            ElectricCar second = new ElectricCar("Tesla", "2020", 2, 300, Consumption.High, EngineType.Electric, 500, 200);

            FuelCar prva  = new FuelCar("Mercedes", "A", 4, 220, Consumption.Economic, EngineType.Disel, 50, 20);
            FuelCar vtora = new FuelCar("Opel", "Astra", 5, 180, Consumption.Economic, EngineType.Petrol, 40, 30);



            second.Drive(4000);

            first.Drive(300);
            Console.WriteLine($" After driving and before recharing your car you have:{first.BateryUsage} percents left\n");
            first.Recharge(100);
            Console.WriteLine($"After Recharging, now you have:{first.BateryUsage}percents battery \n");

            first.Recharge(6000);



            prva.Drive(20);
            Console.WriteLine($"The fuel before Refuling and after Driving you have: {prva.CurentFuel}L\n");
            prva.Refule(20);
            Console.WriteLine($" The Car after Refuling has :{prva.CurentFuel}L of fuel\n");


            vtora.Drive(1000);
            vtora.Refule(1000);



            Console.ReadLine();
        }
Example #7
0
        static void Main(string[] args)
        {
            ElectricCar tesla     = new ElectricCar("Tesla", "Model S", 4, 262, Consumption.Economic, 2000);
            ElectricCar bmw       = new ElectricCar("BMW", "I3", 4, 242, Consumption.Economic, 1000);
            ElectricCar chevrolet = new ElectricCar("Chevrolet", "I3", 4, 242, Consumption.Economic, 1458);

            tesla.Drive(120);
            bmw.Drive(250000);
            chevrolet.Drive(250);


            tesla.Recharge(20);
            bmw.Recharge(100);
            chevrolet.Recharge(5);

            FuelCar opel    = new FuelCar("Opel", "Astra", 4, 220, Consumption.Medium, 1800, 1000);
            FuelCar renault = new FuelCar("Renault", "Clio", 2, 180, Consumption.High, 1500, 1000);

            opel.EngineType = EngineType.Disel;
            opel.Drive(200000);
            opel.Refuel(1800);

            renault.Drive(2500);
            renault.Refuel(500);
        }
Example #8
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 #9
0
        static void Main(string[] args)
        {
            ElectricCar elCar   = new ElectricCar("Tesla", "Model S", 5, 240, Consumption.Economic, 100, 40);
            FuelCar     fuelCar = new FuelCar("Renault", "Megane", 5, 200, Consumption.Medium, EngineType.Diesel, 50, 5);


            elCar.Recharge(5000);
            fuelCar.Drive(50);

            fuelCar.Refuel(200);
            Console.ReadLine();
        }
Example #10
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 #11
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 #12
0
        static void Main(string[] args)
        {
            ElectricCar toyota  = new ElectricCar("Toyota", "Auris", 3, 130, Consumption.Economic, 120, 10);
            ElectricCar honda   = new ElectricCar("Honda", "Civic", 3, 160, Consumption.Medium, 130, 20);
            ElectricCar hyundai = new ElectricCar("Hyundai", "Limo", 5, 190, Consumption.High, 150, 38);
            ElectricCar toyota2 = new ElectricCar("Toyota", "Celica", 5, 150, Consumption.Medium, 140, 15);



            FuelCar bmw      = new FuelCar("BMW", "535i", 3, 220, Consumption.High, EngineType.Petrol, 60, 40);
            FuelCar mercedes = new FuelCar("Mercedes", "GLS", 5, 200, Consumption.High, EngineType.Diesel, 80, 60);
            FuelCar audi     = new FuelCar("Audi", "A3", 3, 205, Consumption.Medium, EngineType.Petrol, 55, 38);
            FuelCar opel     = new FuelCar("Opel", "Astra", 3, 190, Consumption.Economic, EngineType.Diesel, 65, 42);

            Console.WriteLine(bmw.Drive(60));
            Console.WriteLine(toyota.Drive(24));


            Console.ReadLine();
        }
Example #13
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 #14
0
        static void Main(string[] args)
        {
            Car Volvo = new Car();

            Volvo.Id             = Volvo.GenerateID();
            Volvo.Brand          = "Volvo";
            Volvo.Model          = "XC40";
            Volvo.Doors          = 5;
            Volvo.TopSpeed       = 270;
            Volvo.CarConsumption = Consumption.Economic;
            Volvo.CarEngine      = EngineType.Electric;

            Volvo.PrintInfo();


            ElectricCar Audi = new ElectricCar();

            Audi.CarConsumption = Consumption.Medium;
            Console.WriteLine(Audi.BatteryCapacity);
            Audi.Drive(400);
            Console.WriteLine(Audi.BatteryCapacity);
            Audi.Recharge(750);

            FuelCar Ferrari = new FuelCar();

            Ferrari.CarConsumption = Consumption.High;
            Ferrari.CarEngine      = EngineType.Petrol;
            Console.WriteLine(Ferrari.CurrentFuel);
            Ferrari.Drive(100);
            Console.WriteLine(Ferrari.CurrentFuel);
            Ferrari.Refuel(55);



            Console.WriteLine("SUP?");

            Console.ReadLine();
        }
Example #15
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();
        }