Final answer:
You must define generic classes 'Course' and 'Student' with certain private fields, constructors, comparison logic for sorting, and toString methods for string representations.
Step-by-step explanation:
To complete the LabProgram.java, you need to define two generic classes: Course and Student. The Course class will have private fields for department and number, as well as a constructor, a compareTo method for sorting, and a toString method that returns the course's string representation. Likewise, the Student class will have private fields for firstName, lastName, and GPA, plus similar methods tailored to sorting students based on GPA (descending), lastName, and firstName (both ascending).
Here's an example of what those classes could look like:
// Within Course class
private String department;
private Integer number;
// Constructor and methods...
// Within Student class
private String firstName;
private String lastName;
private double GPA;
// Constructor and methods...
After filling ArrayLists with courses and students and sorting them, you'll output the sorted lists, displaying the information in the specified format.