java two easy exercise
COMP 1020
Exercise #9
Download the complete emergency room program and add the following features to it:
- The size of the patient list is calculated when it is printed. But there may be occasions where you need the size for something else, such as to track how many people are waiting throughout a day. Add a size instance variable that is updated each time the size of the list changes, and a size() getter method that returns its value (do not recalculate the size each time the method is called). Replace the calculation in print() with this instance variable to test your work.
- The patient list is ordered in reverse order of arrival. It would be nice if it were stored in a more meaningful order. Modify the add method so that new patients are stored in the list first in order of severity (highest to lowest), and for those with the same severity, in increasing order of arrival time. You will need to add a new method to Patient.
Submit your complete revised PatientList and Patient classes by the due date specified in the course schedule.