Question: A practice coding example that I would like to see the code for using LinkedLists! Will help with upcoming exam! You are required to use
A practice coding example that I would like to see the code for using LinkedLists!
Will help with upcoming exam!
You are required to use the Java LinkedList class lists in this assignment.
Enrollment Management System
A university has requested the development of an enrollment management system. This system will be responsible for managing course information, student information, and enrollments of students in courses. The fundamental operations required of this system are as follows:
Add a course to the system
o A course can only be added one frne to the system
Get all courses known to the system o A well formatted string containing data on all courses o Course data should appear in sorted order
Get all students known to the system o A well formatted string containing data on all students o Student data should appear in sorted order
Add a student to the system o A student can only be added one frne to the system
Enroll a student in a course o A student can only be enrolled in a course one frne
Get all students enrolled in a course o A well formatted string containing data on all enrolled students
o Student data should appear in sorted order
Drop a student from a course Get all courses a student is enrolled in o A well formatted string containing data on the student's courses o Course data should appear in sorted order
High Level Design Observations
There are several things which can be stated about the design of this system. l. The system will contain a list of all courses. 2. The system will contain a list of all students. 3. Each course will contain a list of students enrolled in the course. 4. Each student will contain a list of the courses they are enrolled in.
Course info Class
The information required for each course is as follows: course id, course name, instructor days the course meets, frne the course meets room number list of enrolled students
The first 6 items are all strings. The only constructor takes 6 parameter values and stores them into the properties. The class should implement the toString method to return a formatted string with all 6 data values clearly identified. An example format appears below:
CID: CS2100 Name: Data Structures Prof: Profname Days: MWF Time: 3:00-3:55 Room: RC370
This class also needs to implement the Comparable interface, thereby enabling the use of sorting tools to sort a list of courses based on the course id.
Student Info Class
The information required for each student is as follows: student id, student name both of these are sfrings list of courses the student is enrolled in
The only constructor takes 2 parameter values and stores them into the properties. The class should implement the toString method to return a formatted string with both data values clearly identified. An example format appears below:
Name: Nebula, Georgina S. SID: w004gsn
This class also needs to implement the Comparable interface, thereby enabling the use of sorting tools to sort a list of students based on the student name.
Enrollment Manager Class
The information required for this class is as follows:
List of Course Info objects
List of Student Info objects
The methods which must be provided by this class include:
A method to add a course o All 6 pieces of course information must be passed in
o If the course id is already in the list of courses, print an error message
A method to get a string containing formatted data on all courses (in sorted order)
A method to add a student o Both pieces of student information must be passed in o If the student id is already in the list of students, print an error message
A method to get a string containing formatted data on all students (in sorted order)
A method to enroll a student in a course o If the student does not exist, print an error message o If the course does not exist, print an error message o If the student is already enrolled in the course, print an error
A method to drop a student from a course o If the student does not exist, print an error message o If the course does not exist, print an error message o If the student is not enrolled in the course, print an error
A method to get a string containing formatted data about the students enrolled in a course
(in sorted order) o If the course does not exist, print an error message
A method to get a string containing formatted data about the courses a student is enrolled in (in sorted order) o If the student does not exist, print an error message
Testing
The test program must thoroughly test the Enrollment Manager class. It should add at least 10 students and 10 courses. Make sure to add the courses out of order. Make sure to attempt to add a duplicate course and a duplicate student.
Create test cases to enroll at least 2 students into at least 4 different courses. Try enrolling the same student into the same course twice. Create test cases to enroll at least 4 students into the same class. Create test cases to drop a student from a course.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
