Question: 1.) Create a new class called Course, with attributes such as FIUCourseName, credits, FloridaCourseName, arrayList of preRequisites, and yearLevel. The Course class must implement the

1.) Create a new class called Course, with attributes such as FIUCourseName, credits, FloridaCourseName, arrayList of preRequisites, and yearLevel. The Course class must implement the Comparable interface, using the compareTo() method to compare by FIUCourseName. The Course class' toString() method should include printing all the pre-requisites too, which are part of the course object. You will need 2 more comparator objects, to allow the comparison by FloridaCourseName, or by yearLevel.

2.) Create a new driver class whose main method will call at least 2 methods, one to create an arrayList of Course objects, and another to display a menu of options for the user.

The first method called from main will create an arrayList of Course objects by prompting the user to enter the core courses required for the IT major, and asking for all the information required to populate all the attributes of the Course object. Once done, the method will ask the user if he/she wants to enter another course. This will continue until the user replies that he/she is done entering the course information.

The second method called from main will continuously display a menu to the user, to select which the order in which to print the Course arrayList : by FIUCourseName by FloridaCourseName by yearLevel or exit the menu

Once a menu option is selected, the appropriate Collections.sort method will be called, and the arrayList will be printed in that order: a.) using either the Comparable interface to sort by FIUCourseName b.) using a Comparator object to sort by yearLevel c.) using a Comparator object to sort by FloridaCourseName.***

***Remember: Allow the user to sort in multiple ways without having to re-start the whole program, and re-enter all the data. (Hint: use a while loop)

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!