Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            string name, surname, position, cathedra, higheredinst, secshoolname, group, faculty;
            int    birthday, birthmonth, birthyear, zno1, zno2, zno3, educdocum, course, number, startday, startmonth, startyear, fee;

            name     = "Виталий"; surname = "Граб"; position = "Ректор"; cathedra = "Математический Анализ"; higheredinst = "ДУ\"ЖП\"";
            birthday = 1; birthmonth = 1; birthyear = 1980;
            Teacher Vi_Grab = new Teacher(name, surname, birthday, birthmonth, birthyear, position, cathedra, higheredinst);

            Vi_Grab.ReadValue();
            name     = "Владимир"; surname = "Поливайко"; secshoolname = "ЗОШ №5";
            birthday = 3; birthmonth = 4; birthyear = 2001; zno1 = 160; zno2 = 189; zno3 = 177; educdocum = 12;
            Enrollee Vl_Pol = new Enrollee(name, surname, birthday, birthmonth, birthyear, zno1, zno2, zno3, educdocum, secshoolname);

            Vl_Pol.ReadValue();
            name     = "Ярослав"; surname = "Демченко"; group = "ИПЗ-19-2";  faculty = "ФИКТ"; higheredinst = "ДУ\"ЖП\"";
            birthday = 8; birthmonth = 12; birthyear = 2001; course = 1;
            Student Ya_De = new Student(name, surname, birthday, birthmonth, birthyear, course, group, faculty, higheredinst);

            Ya_De.ReadValue();
            name     = "Оля"; surname = "Горькая";
            birthday = 31; birthmonth = 10; birthyear = 2004; number = 880035; startday = 20; startmonth = 10; startyear = 2019; fee = 50;
            LibraryUser Olya_Go = new LibraryUser(name, surname, birthday, birthmonth, birthyear, number, startday, startmonth, startyear, fee);

            Olya_Go.ReadValue();
            WriteLine("Предлагаю изменить пару полей юзера...\n1 - ректор\n2 - абитуриента\n3 - студента" +
                      "\n4 - посетительницы библиотеки\n0 - отказ и выход.\n");
            int n;

            do
            {
                n = int.Parse(ReadLine());
                switch (n)
                {
                case 1:
                    Vi_Grab.SetValue();
                    Vi_Grab.ReadValue();
                    Write("Ещё-раз? С вас число.\t");
                    break;

                case 2:
                    Vl_Pol.SetValue();
                    Vl_Pol.ReadValue();
                    Write("Ещё-раз? С вас число.\t");
                    break;

                case 3:
                    Ya_De.SetValue();
                    Ya_De.ReadValue();
                    Write("Ещё-раз? С вас число.\t");
                    break;

                case 4:
                    Olya_Go.SetValue();
                    Olya_Go.ReadValue();
                    Write("Ещё-раз? С вас число.\t");
                    break;

                case 0:
                    WriteLine("До свидания!");
                    break;

                default:
                    WriteLine("Введите значения от 1 до 4 или 0 для выходаю");
                    break;
                }
            } while (Convert.ToBoolean(n));
            ReadKey();
        }