コード例 #1
0
        static void Main(string[] args)
        {
            Vehicle a = new Vehicle {
                Year = 1994, Make = "Chevrolet", Model = "Camaro", NumberOfWheels = 4
            };

            Vehicle b = new Vehicle(2004, "Ford", "Mustang", 4);

            Vehicle c = new Car(2017, "Ford", "Gt-50", 4, 2, 3.6, true);

            Vehicle d = new Truck(2000, "Dodge", "Ram", 4, false, "King", true);

            a.GetInformation();

            Console.WriteLine("\n");

            b.GetInformation();

            Console.WriteLine("\n");

            c.GetInformation();

            d.GetInformation();

            d.VehicleParked = true;

            TurnVehicleOn(d);

            d.VehicleParked = false;

            Drive(d);

            d.VehicleDriving = false;

            d.VehicleParked = true;

            TurnVehicleOff(d);

            GetCount();

            Console.WriteLine("\nPress any key to close...");
            Console.ReadKey();
        }