Question: Create a CourseNameComparator class, CourseCreditComparator class, and a CourTimeComparator class. If you need anymore info let me know. CourseNameComparator, CourseCreditComparator, CourseTimeComparator classes: An object of

Create a CourseNameComparator class, CourseCreditComparator class, and a CourTimeComparator class. If you need anymore info let me know.

Create a CourseNameComparator class, CourseCreditComparator class, and a CourTimeComparator class. If you

CourseNameComparator, CourseCreditComparator, CourseTimeComparator classes: An object of any of the three above classes implements the Comparator interface from java.util to help with saving course schedules in different ways. Each class has the following public behavior: Method Description A zero-argument constructor. (You don't actually need to write a constructor if it would be empty; but you may not add one that requires parameters.) Returns an integer indicating this course's placement in the natural ordering of times relative to the given other time, as per the contract of compare from the Java API Specification for Comparator. Course Comparator () CourseNameComparator: Compares solely by name in alphabetical order. If two courses have the same name, they are considered equal CourseCreditComparator: Compares first by number of credits in ascending order, breaking ties by comparing names in alphabetical order. If two courses have the same number of credits and same name, they are considered equal compare (coursel, course2) CourseTimeComparator: Compares first by start time in ascending chronological order, breaking ties by ending time (or duration) in ascending chronological order, and finally breaking ties by name in alphabetical order. In other words, if a course begins at an earlier time, it comes earlier in the ordering. If two courses start at the same time, the one that ends sooner comes earlier in the ordering. If two courses have the same start/end time and name, they are considered equal

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!