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

            um.MaleStudents();
            um.FemaleStudents();
            um.SortStudentsByAge();
            um.AllStudentsFromCSULB();

            um.StudentAndUniversityNameCollection();

            /*
             * // one way of reversing ints
             * int[] someInts = { 30, 12, 4, 3, 12 };
             * IEnumerable<int> sortedInts = from i in someInts orderby i select i;
             * IEnumerable<int> reversedInts = sortedInts.Reverse();
             *
             * foreach (int i in reversedInts)
             * {
             *  Console.WriteLine(i);
             * }
             *
             *
             * //another way of reversing ints
             * IEnumerable<int> reversedInts2 = from i in someInts orderby i descending select i;
             *
             * foreach (int i in reversedInts2)
             * {
             *  Console.WriteLine(i);
             * }
             *
             */

            // This will print out all students with a chosen Id

            /*
             * string input = Console.ReadLine();
             * try
             * {
             *  int intInput = Convert.ToInt32(input);
             *  um.AllStudentsWithSpecificUniId(intInput);
             * }
             * catch (Exception)
             * {
             *
             *  Console.WriteLine("Please enter a valid number.");
             * }
             *
             */

            Console.ReadKey();
        }
Пример #2
0
        static void Main(string[] args)
        {
            UniversityManager um = new UniversityManager();

            um.GenderStudents("male");
            um.GenderStudents("female");
            um.SortStudentsByAge();
            um.AllStudentsFromBeijingTech();
            //um.AllStudentsFromInput();
            um.StudentAndUniversityNameCollection();

            /*
             * int[] someInts = { 30, 12, 4, 3, 12 };
             * IEnumerable<int> sortedInts = from i in someInts orderby i select i;
             * IEnumerable<int> reversedInts = sortedInts.Reverse();
             *
             * foreach(int i in reversedInts)
             * {
             *  Console.WriteLine(i);
             * }
             *
             * IEnumerable<int> reversedSortedInts = from i in someInts orderby i descending select i;
             *
             * foreach(int i in reversedSortedInts)
             * {
             *  Console.WriteLine(i);
             * }
             *
             *
             *
             *
             * // this try catch is part of his solution
             * string input = Console.ReadLine();
             * try
             * {
             *  int inputAsInt = Convert.ToInt32(input);
             *  um.AllStudentsFromThatUni(inputAsInt);
             * }
             * catch (Exception)
             * {
             *
             *  Console.WriteLine("Wrong Value");
             * }
             */

            Console.ReadKey();
        }
Пример #3
0
        static void Main(string[] args)
        {
            UniversityManager um = new UniversityManager();

            um.MaleStudents();
            um.FemaleStudents();
            um.SortStudentsByAge();
            um.AllStudentsFromIllinoisStateUniversity();

            um.StudentAndUniversityNameCollection();

            /* This is a way of sorting:
             * int[] someInt = { 30, 12, 4, 3, 12 };
             * IEnumerable<int> sortedInts = from i in someInt orderby i select i;
             * IEnumerable<int> reversedInts = sortedInts.Reverse();
             *
             * foreach(int i in reversedInts)
             * {
             *  Console.WriteLine(i);
             * }
             *
             * IEnumerable<int> reversedSortedInts = from i in someInt orderby i descending select i;
             *
             * foreach (int i in reversedSortedInts)
             * {
             *  Console.WriteLine(i);
             * }
             */

            /*
             * Console.WriteLine("Which University to see?");
             * try
             * {
             *  string inputUniversity = Console.ReadLine();
             *  int universityInput = Convert.ToInt32(inputUniversity);
             *  um.AllStudentsFromThatUniversity(universityInput);
             * }
             * catch (Exception)
             * {
             *  Console.WriteLine("Wrong Value");
             * }
             */
            Console.ReadKey();
        }