Exemplo n.º 1
0
        static void Main(string[] args)
        {
            var courseService = new CourseService();

            Console.Write("How many students for course A? ");
            var quantity = int.Parse(Console.ReadLine());
            var A        = courseService.AddStudents(quantity);

            Console.Write("How many students for course B? ");
            quantity = int.Parse(Console.ReadLine());
            var B = courseService.AddStudents(quantity);

            Console.Write("How many students for course C? ");
            quantity = int.Parse(Console.ReadLine());
            var C = courseService.AddStudents(quantity);

            var D = new SortedSet <int>();

            D.UnionWith(A);
            D.UnionWith(B);
            D.UnionWith(C);

            Console.Clear();
            courseService.Print("A", A);
            courseService.Print("B", B);
            courseService.Print("C", C);
            Console.WriteLine();
            Console.WriteLine("Total Students: " + D.Count);
        }