Junior — Senior
Modeling the queue of patients in the doctor's office
livecode
Task condition
Create a class MedicalOffice that implements the queue logic in a medical office.
- Method
register()— adds a new patient to the end of the queue. - Method
accept()— removes the first patient from the queue and displays the message: "Patient accepted."
public class Main {
public static void main(String[] args) {
// usage example
}
}