Problem 1 (25 points) The Registrar's office is asked to generate several reports for enrolled students at the Universit
Posted: Fri May 20, 2022 5:56 pm
Problem 1 (25 points) The Registrar's office is asked to generate several reports for enrolled students at the University. These reports are to list the student's name and id number (separated with a */) along with their Major, Gpa, and projected graduation year (classof). Part 1 Create a class called Student to hold individual Student information that includes: name - (String) - the full name of the student id (int) - The student id major - (String) - The major of the student gpa (double) - The grade point average of the student classOf (int) - Projjected graduation year Add getters and setters for the 5 members of the class. The President asks for a report of all students and he wants it sorted by 2 criteria: Major and Gpa. Specifically, he says 'please sort it by descending Gpa within Major'. Note that this is a tiered sort with 2 criteria. So all of the students with the same major are together in the sorted list. Within the groups of students for a specific major ((i.e. CS, TSM, etc), that group is sorted by descending Gpa. You can start with the Selection Sort code provided in Selection.java. However, your task is to craft a compareTo() method that will properly sort the students by the double criteria. Remember, you are only allowed a single compareTo so you will have to figure out how to look at both at once to determine ordering! Also, write a toString() method to return a string of the form: (major : gpa : classOf: name/id) Note that we are printing the two fields on which we are sorting at the beginning of the line so the President can easily see the groups of students and their ranking within the major! Implement this class and use the provided UseStudent.java to test your compareTo() method.