Exemplo n.º 1
0
        static void Main(string[] args)
        {
            Cars Pejo307 = new Cars();

            Pejo307.Marka     = " Pejo 307 ";
            Pejo307.ModelYılı = 2003;
            Pejo307.Fiyat     = 60000;
            Pejo307.Renk      = "Mavi";
            Pejo307.Vites     = "Tam Otomatik";

            Cars PejoPatner = new Cars();

            PejoPatner.Marka     = "Pejo Patner";
            PejoPatner.ModelYılı = 2014;
            PejoPatner.Fiyat     = 70000;
            PejoPatner.Renk      = "Toz Rengi";
            PejoPatner.Vites     = "5 Vitesli";


            Cars[] cars = new Cars[] { Pejo307, PejoPatner };

            //foreach (var car in cars)
            //{
            //    Console.WriteLine(" Markası    : " + car.Marka);
            //    Console.WriteLine(" Model Yılı : " + car.ModelYılı);
            //    Console.WriteLine(" Fiyatı     : " + car.Fiyat + " TL"); ;
            //    Console.WriteLine(" Renk       : " + car.Renk);
            //    Console.WriteLine("---------------------------------43");
            //}

            //Console.WriteLine(" Araç Sayısı  : " + cars.Length);

            CarsManager carsManager = new CarsManager();

            carsManager.Add(Pejo307);

            carsManager.Add2(" Opel", 20000, " siyah");

            carsManager.Delete(PejoPatner);

            carsManager.GetAll(Pejo307);


            Console.WriteLine("--------");
            Console.WriteLine("SMTcoder");
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            var info = "Cars Information:";

            Brands car1 = new Brands();

            car1.AutoMark = "Range Rover";
            car1.Location = "Baku";
            car1.Price    = 152000;
            car1.Year     = 2020;

            Brands car2 = new Brands();

            car2.AutoMark = "Nissan Murano";
            car2.Location = "Baku";
            car2.Price    = 24300;
            car2.Year     = 2013;

            Brands car3 = new Brands();

            car3.AutoMark = "BMW 545";
            car3.Location = "Gence";
            car3.Price    = 17500;
            car3.Year     = 2005;

            Brands car4 = new Brands();

            car4.AutoMark = "Hyundai Tucson";
            car4.Location = "Baku";
            car4.Price    = 30000;
            car4.Year     = 2019;

            Brands[] products = new Brands[] { car1, car2, car3, car4 };

            Console.WriteLine(info);
            Console.WriteLine("---------------------");
            foreach (var cars in products)
            {
                Console.WriteLine(cars.AutoMark);
                Console.WriteLine(cars.Location);
                Console.WriteLine(cars.Price);
                Console.WriteLine(cars.Year);

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

            CarsManager automobile = new CarsManager();

            automobile.Add1(car1);
            automobile.Add1(car2);

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

            automobile.Add2(car3);
            automobile.Add2(car4);

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

            automobile.Add3(car1);
            automobile.Add3(car2);
            automobile.Add3(car3);
            automobile.Add3(car4);

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

            Console.ReadLine();
        }