Question: C# Programming Platform II Sorting Basics Step 1: Make a console application named yourname_sortingbasics. Make sure that you use a windows classic desktop console application/.Net
C# Programming Platform II Sorting Basics
Step 1: Make a console application named yourname_sortingbasics. Make sure that you use a windows classic desktop console application/.Net Framework console application and not a .Net Core console application. Step 2: Make a Student class that has the following: a. StudentID, LastName, FirstName, CourseID and Course Grade properties. b. A constructor that collects the above property information. c. A method that retrieves test data for this Student class. This method will use the following code for testing purposes: public static List e. Support methods for adding a sort title and column headers for a report on your student data. These methods will be used to display student data before and after various sorting conditions. Step 3: In your main method test your Employee class with the following code: List Note: Google string format operations to see what options you have in terms of using right hand justification, left hand justification, PadLeft, PadRight, etc. Step 4: Modify your Student class to add a default last name, first name sort capability. The IComparable interface is used typically to compare the current class instance with other instances of the same type. To use this technique, you would add to the Student class the IComparable 10 points are scored if you correctly implement the CompareTo method to provide this last name, first name sort capability. To test your CompareTo method in your main method add the following code: // Sort using built in Student IComparer default sort... Console.WriteLine(Student.SortTitle("Sorted by Last Name and First Name Using Built in IComparable")); Console.WriteLine(Student.ColumnHeader()); students.Sort(); foreach (Student s in students) { Console.WriteLine(s); } Your console screen should then show the following: Note: Original data is preserved. However, you can output upper cased string data if you wish. Step 5: Now examine the common situation of multiple sorts done on multiple sort fields. The IComparer
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
