示例#1
0
        static void Main(string[] args)
        {
            StudentWithSpecialty prog  = new StudentWithSpecialty("Ваня", "БГУИР", "Программист");
            StudentWithSpecialty math  = new StudentWithSpecialty("Маша", "БГУИР", "Математик");
            StudentWithSpecialty paint = new StudentWithSpecialty("Петя", "БГУ", "Художник");

            prog.Show();
            Person.peopleAmount();

            Console.ReadKey();
        }
示例#2
0
        private static void Main(string[] args)
        {
            string name, university, faculty, answer;
            int    age, activation;

            Console.WriteLine("Enter Name :");
            name = Console.ReadLine();

            Console.WriteLine("Enter age :");
            age = Convert.ToInt32(Console.ReadLine());

            Console.WriteLine("Enter university :");
            university = Console.ReadLine();

            Console.WriteLine("Enter faculty :");
            faculty = Console.ReadLine();

            StudentWithSpecialty student = new StudentWithSpecialty(name, age, university, faculty);

            while (true)
            {
                Console.WriteLine("\nChoose a function:\n1) Print Info\n2) Enter the Universite\n");
                activation = Convert.ToInt32(Console.ReadLine());
                switch (activation)
                {
                case 1:
                    student.PrintInfo();
                    break;

                case 2:
                    Console.WriteLine("\nHave you got documents?");
                    answer = Console.ReadLine();
                    if (answer == "No")
                    {
                        student.EnterTheUniversity();
                    }
                    else if (answer == "Yes")
                    {
                        Console.WriteLine("What documents have you got?");
                        answer = Console.ReadLine();
                        student.EnterTheUniversity1(answer);
                    }

                    break;
                }
            }
        }