示例#1
0
        static void Main(string[] args)
        {
            Car myCar = new Car();
            myCar.Make = "BMW";
            myCar.Model = "745li";
            myCar.Year = 2005;
            myCar.Color = "Black";
            printVehicleDetails(myCar);

            Truck myTruck = new Truck();
            myTruck.Make = "Ford";
            myTruck.Model = "F950";
            myTruck.Year = 2006;
            myTruck.Color = "Black";
            myTruck.TowingCapacity = 1200;
            printVehicleDetails(myTruck);

            Console.ReadLine();
        }
        static void Main(string[] args)
        {
            Car myCar = new Car();
            myCar.Maker = "BMW";
            myCar.Colour = "Grey";
            myCar.Year = 2015;
            myCar.Model = "1 Series";

            //new instance of Truck
            Truck myTruck = new Truck();
            myTruck.Year = 2005;
            myTruck.Maker = "Ford";
            myTruck.Colour = "Cherry red";
            myTruck.Model = "f350";
            myTruck.TowingCapacity = 3;

            printCarDetails(myCar);
            printCarDetails(myTruck);
            Console.ReadLine();
        }
示例#3
0
        static void Main(string[] args)
        {
            Car myCar = new Car();
            myCar.Make = "BMW";
            myCar.Model = "i8";
            myCar.Color = "Grey";
            myCar.Year = 2015;

            printVehicleDetails(myCar);

            Truck myTruck = new Truck();

            myTruck.Make = "Ford";
            myTruck.Model = "F-450";
            myTruck.Color = "Brown";
            myTruck.Year = 2015;
            myTruck.TowingCapacity = 31200;
            printVehicleDetails(myTruck);

            Console.ReadLine();
        }
示例#4
0
        static void Main(string[] args)
        {
            Car myCar = new Car();
            myCar.Make = "BMW";
            myCar.Model = "lhgi1232";
            myCar.Year = 2001;
            myCar.Color = "Grey";

            PrintVehicledetails(myCar);
            Console.ReadLine();

            Truck myTruck = new Truck();
            myTruck.Make = "Ford";
            myTruck.Model = "gti123";
            myTruck.Year = 2010;
            myTruck.Color = "Brown";
            myTruck.CapacityinTons = 1234567;

            PrintVehicledetails(myTruck);
            Console.ReadLine();
        }
        static void Main(string[] args)
        {
            Car myCar = new Car();
            myCar.Make = "Honda";
            myCar.Model = "Civic";
            myCar.Year = 1998;
            myCar.Color = "Red";

            printVehicleDetail(myCar);

            Truck myTruck = new Truck();
            myTruck.Make = "Ford";
            myTruck.Model = "F950";
            myTruck.Year = 2006;
            myTruck.Color = "Purple";
            myTruck.TowingCapacity = 1500;

            printVehicleDetail(myTruck);

            Console.ReadLine();
        }
示例#6
0
        static void Main(string[] args)
        {
            Car myCar = new Car();
            myCar.Make = "BMW";
            myCar.Model = "745li";
            myCar.Color = "Black";
            myCar.Year = 2005;

            Truck myTruck = new Truck();
            myTruck.Make = "Ford";
            myTruck.Model = "F950";
            myTruck.Year = 2006;
            myTruck.Color = "Black";
            myTruck.TowingCapacity = 1200;

            //someMethod(myCar);
            //someMethod(myTruck);

            myCar.PrintMe();
            myTruck.PrintMe();

            Console.ReadLine();
        }