Пример #1
0
        static void Main(string[] args)
        {
            var zero   = new Zero();
            var tesla  = new Tesla();
            var cessna = new Cessna();
            var ram    = new Ram();

            zero.MainColor         = "White";
            tesla.MaximumOccupancy = 5;

            zero.Drive();
            tesla.Drive();
            cessna.Drive();
            ram.Drive();
        }
Пример #2
0
        static void Main(string[] args)
        {
            Zero   fxs           = new Zero();
            Tesla  modelS        = new Tesla();
            Cessna mx410         = new Cessna();
            Ram    realFastModel = new Ram();

            fxs.Drive();
            modelS.Drive();
            mx410.Drive();
            Console.WriteLine($"");
            realFastModel.Drive();
            realFastModel.Stop();
            realFastModel.Turn();

            string ramColor = "Red";

            Console.WriteLine($"My new Dodge is {ramColor}");
        }
Пример #3
0
        static void Main(string[] args)
        {
            Console.WriteLine("The motorcycle");
            Zero Motorcycle = new Zero();

            Motorcycle.MaximumOccupancy = "2";
            Console.WriteLine($"Motorcycle max occupancy: {Motorcycle.MaximumOccupancy}");
            Motorcycle.ChargeBattery();
            Motorcycle.Drive();

            Console.WriteLine("The Tesla");
            Tesla Car = new Tesla();

            Car.MaximumOccupancy = "5";
            Console.WriteLine($"Car max occupancy: {Car.MaximumOccupancy}");
            Car.SelfDriving = true;
            Console.WriteLine($"Car self driving: {Car.SelfDriving}");
            Car.ChargeBattery();
            Car.Drive();

            Console.WriteLine("The Ram");
            Ram Truck = new Ram();

            Truck.MaximumOccupancy = "2";
            Console.WriteLine($"Truck max occupancy: {Truck.MaximumOccupancy}");
            Truck.TowCapacity = "1 ton";
            Console.WriteLine($"Truck tow capacity: {Truck.TowCapacity}");
            Truck.Drive();

            Console.WriteLine("The Plane");
            Cessna Plane = new Cessna();

            Plane.MaximumOccupancy = "4";
            Console.WriteLine($"Plane max occupancy: {Plane.MaximumOccupancy}");
            Plane.Drive();

            Console.WriteLine("The CR-V");
            Honda Crv = new Honda();

            Crv.MaximumOccupancy = "5";
            Console.WriteLine($"CRV max occupancy: {Crv.MaximumOccupancy}");
            Crv.Drive();
        }
        static void Main(string[] args)
        {
            Vehicle fxs = new Zero()
            {
                BatteryKWh       = 400,
                MainColor        = "green",
                MaximumOccupancy = "5 Passengers"
            };
            Vehicle modelS = new Tesla()
            {
                BatteryKWh       = 650,
                MainColor        = "blue",
                MaximumOccupancy = "5 Passengers"
            };
            Vehicle mx410 = new Cessna()
            {
                FuelCapacity     = 325,
                MainColor        = "white",
                MaximumOccupancy = "2 Passengers"
            };
            Vehicle f250 = new Ram()
            {
                FuelCapacity     = 275,
                MainColor        = "black",
                MaximumOccupancy = "6 Passengers"
            };

            fxs.Drive();
            modelS.Drive();
            mx410.Drive();
            f250.Drive();

            fxs.Stop();
            modelS.Stop();
            mx410.Stop();
            f250.Stop();

            fxs.Turn("left");
            modelS.Turn("right");
            mx410.Turn("left");
            f250.Turn("right");
        }
Пример #5
0
        static void Main(string[] args)
        {
            var cessna = new Cessna()
            {
                MainColor        = "white",
                MaximumOccupancy = 5,
                FuelCapacity     = 2.3
            };
            var ram = new Ram()
            {
                MainColor        = "blue",
                MaximumOccupancy = 6,
                FuelCapacity     = 5.4
            };
            var tesla = new Tesla()
            {
                MainColor        = "black",
                MaximumOccupancy = 5,
                BatteryKWh       = 2.3
            };
            var zero = new Zero()
            {
                MainColor        = "silver",
                MaximumOccupancy = 2,
                BatteryKWh       = 4.3
            };

            cessna.Drive();
            cessna.Turn();
            cessna.Stop();
            ram.Drive();
            ram.Turn();
            ram.Stop();
            tesla.Drive();
            tesla.Turn();
            tesla.Stop();
            zero.Drive();
            zero.Turn();
            zero.Stop();
        }
Пример #6
0
        static void Main(string[] args)
        {
            var tesla = new Tesla()
            {
                MainColor        = "red",
                MaximumOccupancy = 5,
                TouchScreenWidth = 10.8,
                BatteryKWh       = 300.57
            };

            var zero = new Zero()
            {
                MainColor        = "red",
                MaximumOccupancy = 5,
                OdometerSize     = 3.4,
                BatteryKWh       = 300.57
            };

            var cessna = new Cessna()
            {
                MainColor        = "red",
                MaximumOccupancy = 5,
                Wingspan         = 20,
                FuelCapacity     = 100.50
            };

            var ram = new Ram()
            {
                MainColor        = "red",
                MaximumOccupancy = 5,
                BedLength        = 8,
                FuelCapacity     = 30.50
            };

            ram.Drive();
            cessna.Drive();
            zero.Drive();
            tesla.Drive();

            tesla.Facts();

            // INTERFACES

            Zero  fxs    = new Zero();
            Zero  fx     = new Zero();
            Tesla ModelS = new Tesla();

            List <IChargeable> ElectricTransports = new List <IChargeable>()
            {
                fxs, fx, ModelS
            };

            Cessna myCessna   = new Cessna();
            Cessna yourCessna = new Cessna();
            Ram    myRam      = new Ram();

            List <IRefuelable> GasTransports = new List <IRefuelable>()
            {
                myCessna, yourCessna, myRam
            };
        }