Question
This assignment must be done in Java. In completing this assignment, you must: Use the Test code provided Make sure your output looks EXACTLY like
This assignment must be done in Java.
In completing this assignment, you must:
Use the Test code provided
Make sure your output looks EXACTLY like the expected output
Implement the following classes: Course, CourseSchedule, Registrar.
o A Course consists of a title and a professor's name (who teaches it)
o A CourseSchedule consists of a student name and a list of the courses being taken. Use a Java List to help implement this class.
In addition to whatever other methods are needed, a CourseSchedule will need a display() method to display the list of courses in sorted order (example: ANTHRO 100 comes before MATH 7 because A comes before M).
o A Registrar consists of associations between student names and their course schedules, so that one can easily look up schedules by student name
In addition to whatever other methods are needed, a Registrar will also need a display() method. It will display each CourseSchedule that is registered. No sorting is required between CourseSchedule objects (e.g., Jennie's schedule might occur before Adam's, but the courses within each schedule should still be sorted, per the CourseSchedule instructions above).
NOTES:
To do the sorting, one of your classes will need to implement Comparable, just as we demonstrated in class. We also covered how to sort collections, which again you should review in the slides if you need to.
You should also consider looking at the Javadoc pages for List and Map, in case you need those (do a Google search)
Test code:
Expected Output:
public class Test public static void main(String[] args) // Build Annie's schedule CourseSchedule annieSchedule-new CourseSchedule( "Annie Atom"); annieSchedule.add(new Course("CS 100", "Prof. Smith")); annieSchedule.add(new Course("ANTHRO 10", "Prof. Jones")); annieSchedule.add(new Course("MATH 125", "Prof. Aardvark")); annieSchedule.display(); // Build Myra's schedule CourseSchedule myraSchedule new CourseSchedule( "Myra Moore"); myraSchedule.add (new Course( "CS 233", "Prof. Jensen")); myraSchedule.add (new Course( "CS 234", "Prof. Thomas")); myraSchedule.display); // Build Zach's schedule CourseSchedule zachSchedule- new CourseSchedule( "Zach Zween"); zachSchedule.add(new Course( "PSYCH 140", "Prof. Arnold")); zachSchedule.add (new Course( "ANTHRO 10", "Prof. Jones")); zachSchedule.add (new Course( "FRENCH 1", "Prof. Renior")); zachSchedule.display); // Register all of therm Registrar r-new Registrar(); r.register (annieSchedule); r.register(myraSchedule); r.register(zachSchedule); // De-register a student r.deRegister("Myra Moore"); r.display)Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started