Esempio n. 1
0
        static void Main(string[] args)
        {
            // перечисление
            Console.ForegroundColor = ConsoleColor.Blue;
            Operation op;

            op = Operation.two;
            Console.WriteLine("Перечисление: ");
            Console.WriteLine(op);
            Console.WriteLine((byte)op);

            //структура
            Console.ForegroundColor = ConsoleColor.Cyan;
            Person person = new Person("Daniil", 18, "BSTU", 2);

            person.DisplayPerson();
            Console.WriteLine();
            // наследник
            Console.ForegroundColor = ConsoleColor.Green;
            Ty134 pasanger = new Ty134("pasanger", "transport", "3000", "1", "4");

            Console.WriteLine(pasanger.ToString());
            Console.ForegroundColor = ConsoleColor.White;
            Military military = new Military("military", "transport", "6000", "2", "4");
            Cargo    cargo    = new Cargo("cargo", "transport", "100000", "1", "1");
            Maize    maizy    = new Maize();

            Console.WriteLine("Name:{0}, Number:{1}", maizy.GetName(), maizy.GetType());

            Avialine avialine = new Avialine();

            avialine.ArrAdd         = pasanger;
            avialine.ArrAdd         = military;
            avialine.ArrAdd         = cargo;
            Console.ForegroundColor = ConsoleColor.Blue;
            avialine.ArrPrint       = pasanger;
            avialine.ArrDelete      = cargo;
            Console.ForegroundColor = ConsoleColor.Green;
            avialine.ArrPrint       = pasanger;

            Controler avia = new Controler();

            Console.ForegroundColor = ConsoleColor.Yellow;
            avia.AvialineArray();
            Console.ForegroundColor = ConsoleColor.Cyan;
            avia.AvialineInfoArray();
            Console.ForegroundColor = ConsoleColor.DarkCyan;
            avia.AvialineSortMassArray();
            Console.ForegroundColor = ConsoleColor.DarkGreen;
            avia.FlySearchArray();
            Console.ForegroundColor = ConsoleColor.DarkRed;
            avia.Sum();

            Console.ReadKey();
        }
Esempio n. 2
0
        public void AvialineArray()
        {
            for (int i = 0; i < 3; i++)
            {
                array[i] = new Avialine("Боинг", 40, 3000, 1000000, 450);
                Console.ForegroundColor = ConsoleColor.White;
                Console.WriteLine("\n\nВведите название самолёта");
                array[i].Name = Console.ReadLine();

                Console.WriteLine("\n\nВведите вместимость самолёта:");
                array[i].Capasity = Convert.ToDouble(Console.ReadLine());

                Console.WriteLine("\n\nВведите грузоподъемность самолёта: ");
                array[i].Loadcapacity = Convert.ToDouble(Console.ReadLine());

                Console.WriteLine("\n\nВведите дальность полёта самолёта:");
                array[i].Range = Convert.ToDouble(Console.ReadLine());

                Console.WriteLine("\n\nВведите потребление горючего: ");
                array[i].Fuelconsumption = Convert.ToDouble(Console.ReadLine());
            }
        }