Answer on Question#37847- Programming, C++
1. Sort command to display all the student records in sorted order either by name or by GPA (the sorting criteria is case insensitive)
For example: sort:name
2. Search command to find a student
Solution.
1)
using System.Collections;
SortedList sort;
sort.Add(Name, GPA);
for (int i = 0; i < sort.Count; i++)
{
Console.WriteLine(sort.GetKey(i).ToString());
}Use this design, now the data is sorted by key Name. If you want to sort by value GPA, you need to put in place the values of GPA Name to place the key.
2)
// Can also search by key:
Console.WriteLine(sort[StudentName].ToString());