Пример #1
0
        static void Main(string[] args)
        {
            Car car1 = new Car();
            car1.make = "Ford";
            car1.model = "Fiesta";
            car1.price = 1000;
            car1.mileage = 90000;
            Car.numberOfCars++;

            Car car2 = new Car();
            car2.make = "Vauxhall";
            car2.model = "Corsa";
            car2.price = 4000;
            car2.mileage = 48000;
            Car.numberOfCars++;

            Car car3 = new Car();
            car3.make = "Citroen";
            car3.model = "Xsara";
            car3.price = 2500;
            car3.mileage = 102000;
            Car.numberOfCars++;

            Console.WriteLine("The total number of cars available is {0}", Car.numberOfCars);

            Console.WriteLine("For Car 1 the make is {0}, the model is {1} and the price is £{2}", car1.make, car1.model, car1.price);
            Console.WriteLine("For Car 2 the make is {0}, the model is {1} and the price is £{2}", car2.make, car2.model, car2.price);
            Console.WriteLine("For Car 3 the make is {0}, the model is {1} and the price is £{2}", car3.make, car3.model, car3.price);
        }