Esempio n. 1
0
        static void Main(string[] args)
        {
            Student student;
            int     age = 0, math = 0, physics = 0, rysk = 0;
            string  name = "Name", surname = "Surname", patronymic = "Patronymic";

            try
            {
                Console.WriteLine("Enter surname");
                surname = Console.ReadLine();
                Console.WriteLine("Enter name");
                name = Console.ReadLine();
                Console.WriteLine("Enter patronymic");
                patronymic = Console.ReadLine();
                Console.WriteLine("Enter age");
                age = Convert.ToInt32(Console.ReadLine());
                Console.WriteLine("Enter physics grade");
                physics = Convert.ToInt32(Console.ReadLine());
                Console.WriteLine("Enter math grade");
                math = Convert.ToInt32(Console.ReadLine());
                Console.WriteLine("Enter rysk grade");
                rysk = Convert.ToInt32(Console.ReadLine());
            }
            catch
            {
                Console.WriteLine("Incorrect enter");
                return;
            }
            finally
            {
                Console.WriteLine("Блок finally");
            }
            float srbal = (physics + math + rysk) / 3;

            student = new Student(name, surname, patronymic, age, physics, math, rysk);

            int i = 0;

            for (; ;)
            {
                Console.WriteLine("\n1 - Are you enter?\n2 - Check stuff\n3 - Check lecturer");
                int operat = Convert.ToInt32(Console.ReadLine());

                switch (operat)
                {
                case 1: student.AreyouEnter(srbal); break;

                case 2: Speciality(Operations.Staff); break;

                case 3: Speciality(Operations.Lecturers); break;

                default: Console.Clear(); break;
                }
                i++;
                if (i == 4)
                {
                    break;
                }
            }
            Console.ReadLine();
        }