Question: class Doctor Has a static int variable doctorCounter set to 0 Has the boolean instance variable isFree Has the int instance variables doctorIDNumber, totalPatientsSeenByDoctor, timeRemainingForExam

class Doctor
Has a static int variable doctorCounter set to 0
Has the boolean instance variable isFree
Has the int instance variables doctorIDNumber, totalPatientsSeenByDoctor, timeRemainingForExam
Has the reference variable assignedPatient of type Patient
Has a single default constructor
Calls setDoctorIDNumber with no parameters
Calls setIsFree with true as the value of the parameter
There are simple accessor (getXXX) methods for each of the five instance variables
setDoctorIDNumber has no parameters and a void return
It increments the doctorCounter by 1
It sets the doctorIDNumber equal to the doctorCounter
setIsFree has a boolean parameter and a void return
It sets isFree to the value of the parameter
setAssignedPatient has a reference to a Patient as the parameter and a void return
It sets the reference variable assignedPatient to the value of the parameter
It calls setIsFree with false as the parameter
removeAssignedPatient has no parameters and returns a reference to the assignedPatient
Create a temporary Patient reference variable tempPatient equal to the current assignedPatient for
this Doctor
Set the assignedPatient variable to null
Call setIsFree with the parameter true
Increment totalPatientsSeenByDoctor by 1
Return the value in the tempPatient reference variable
set TimeRemainingForExam has an int parameter and a void return
set timeRemainingForExam to the value of the parameter
decrementTimeRemainingForExam has no parameters and a void return
It decrements timeRemainingForExam by 1
toString has no parameters and returns a String -(normal override)
String should look like this (of course the numbers will be different)
Doctor 17 examines 21 patientsclass PatientPriority implements the Comparator interface for Patient
Note: The idea is that an UrgentPatient has higher priority than SeverePatient who has higher priority than
a Nominal.
This class has one method compare with two parameters, both of which are references to Patient objects.
If the two Patients are of the same patientType (you can use compareTo you wrote for each Patient here),
the one who arrived earlier has a higher priority. This means return a negative, 0 or positive value based
on the difference in the arrivalTimeAtEmergencyFacility between the first and second Patient.
Otherwise use the result of compareTo for the two Patients to obtain the return value
class Doctor Has a static int variable

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 Programming Questions!