Reference no: EM132430685
How would a UML diagram look like that meets the following requirements?
1. Has a "Course" class as follows...
a. Five private instance variables...
i. courseId, a String
1. At LCC we call this a CRN - like "48765" - and it is unique for each class section.
ii. courseName, a String (i.e. "Introduction to Programming with Java")
iii. courseCode, a String (i.e. "CITP 190")
iv. instructor, an Instructor object representing the teacher of the course
b. A final List<Student> object named "roster" which represents the list of students enrolled in the course
c. Public getters and setters for each instance variable except for roster.
d. A public void method named "addStudent" which takes a Student as a parameter and adds it to the roster. Each time a student is added the roster should be sorted alphabetically by student last name then first name.
e. 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.
f. 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:
i. The Course ID
ii. The Course Name
iii. The Course Code
iv. A blank line
v. The String "Instructor"
vi. The String "-------------------------"
vii. The results of the instructor's toString method.
viii. A blank line
ix. The String "Student Roster"
x. The String "-------------------------"
xi. A separate line for each Student object in the roster showing the output of its toString method.