subject
Computers and Technology, 20.08.2021 05:20 Hfruit

Write a Course class. A Course keeps track of Students enrolled in the Course (on the roster) and students on the waitlist for the Course. Implement methods to add a student to the course and drop a student from the course, using these rules: Students on the roster can be stored in any order.
Students on the waitlist should be stored in the order they were added.
A student can only be added to the course if they have paid their tuition.
A student cannot be on the roster or waitlist more than once.
A student cannot be on both the roster and the waitlist.
If a student on the roster drops the course, the first student from the waitlist should be added to the roster (and removed from the waitlist).
When searching for whether a student is on the roster or waitlist, compare the Student ids to see if a student is a match.
Extra Credit
Use an ArrayList: Write a class called CourseAL.
This class has the same methods as Course (listed above). Instead of using a Student[] to store the roster and waitlist, use an ArrayList. You can use the provided tester program to test your extra credit class (comment out line 24 and un-comment line 29).
Important: The equals method in Student compares two Student objects to see if they are the same (which, for our project, means that they have the same ID). This means you should not directly compare the IDs. In the extra credit, you should just compare two Student objects directly. (Remember what method you use to compare objects!)
For full credit, take advantage of the methods in the ArrayList class to implement the methods. Do not just swap out the array for an ArrayList- use the methods from the ArrayList class! You might be able to significantly streamline your code. Note that you will not earn full extra credit if you simply use an ArrayList to mimic an array.

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 00:00, eguzmandpandoracom
How do we use the sumif formula (when dealing with different formats) ?
Answers: 1
image
Computers and Technology, 23.06.2019 12:00, lyn94
Using the list, you can select the number of photos that will appear on each slide. a. theme b. frame shape c. pictures in album d. picture layout
Answers: 1
image
Computers and Technology, 23.06.2019 22:00, elijah1090
Technician a says engine assemblies can be mounted longitudinally in a chassis. technician b says engine assemblies can be mounted transversely in a chassis. who is correct?
Answers: 2
image
Computers and Technology, 24.06.2019 01:30, shonnybenskin8
Hazel has just finished adding pictures to her holiday newsletter. she decides to crop an image. what is cropping an image?
Answers: 1
You know the right answer?
Write a Course class. A Course keeps track of Students enrolled in the Course (on the roster) and st...

Questions in other subjects:

Konu
Mathematics, 25.02.2021 02:50
Konu
Mathematics, 25.02.2021 02:50