Пример #1
0
        static void Main(string[] args)
        {
            int schoolsCount = 1;

            schoolsCount = int.Parse(GetInput("how many schools - (min 1 , max 99+) ?"));
            for (int i = 0; i < schoolsCount; i++)
            {
                string input  = null;
                School school = new School();
                input = GetInput("school name: ");
                school.SetName(input);
                input = GetInput("Enrolled students number in " + school.GetName() + ":");
                school.SetNumber(int.Parse(input));
                schools.Add(school);
            }
            Console.WriteLine("You have added {0} schools", schools.Count);
            schools.Sort((s1, s2) => s1.GetName().CompareTo(s2.GetName()));
            Console.WriteLine("Schools sorted");
            Console.WriteLine();
            PrintSchools();
            Console.ReadLine();
        }