I need some serious help with one of my assignments. The assignment is to make a Course Roster list, be able to add and remove a student, be able to use the Comparable<person>interface, and override tostring methods and return results of another classes tostring method. A lot of this stuff isn't even covered in our book, i've been looking online for days and still need quit a bit of help tying all these classes together. I have all the requirements for each class in the code but i'll list the parts that I need help with. I understand this is a lot so any bit of help or direction with any of these issues would be greatly appreciated! Thanks so much
Person abstract class:
"Implements the comparable<person>interface. This class must override the "int compareTo(Person)"method. This should order the person objects according to the order of their last names and if their last names are the same then use the order of their first names"
Instructor class extends Person abstract class:
"Overrides the toString method from the Person, returning result of Persons toString method (super.toString()) with 2 additional instance variables appended to the end, also separated by tab characters"
Student class extends Person abstract class:
Overrides the toString method from person, returning result of it's Person toString method (super.toString()) with 2 additional instance variables appended to the end also separated by the tab characters.
Course class:
"A final List<Student>object named "roster" which represents the list of students.
A public void method named addStudent which takes a Student as a parameter and adds it to the roster. Should be sorted alphabetically by students last name then first name
A public void method named removeStudent which takes a
String named personId as a parameter and removes any student from the roster who has that personId instance variable.
A public“toString” method with no parameters, returning a String which contains all of the following, each on its own line (use “\n”) in the given order:
The Course ID
The Course Name
TheCourse Code
A blank line
The String “Instructor”
The String “-------------------------“
The results of the instructor’s toString method. <---need help with this
A blank line
The String “Student Roster”
The String “-------------------------"
A separate line for each Student object in the roster showing the output of its toString method <---- need help with this "
Course App:
The teacher provided the code that I have within this class but it's telling me "Instructor cannot be converted to a string"