Q.No.1:Suppose in a Hospital, there are two physicians to deal with patients. Patients of all ages come for their checkup. Physician ‘A’ is designated as physician of old patients while physician ‘B’ has to check other patients. Many patients come to the hospital at the same time. There are two queues of patients against each physician. If patient is an old man, he will stand in second queue; otherwise he will stand in first queue. Both doctors check their patients one by one on first come first served basis. Due to timing restriction of the hospital, each doctor can check a maximum of 20 patients per day. You are required to write a program in C++ to implement the above scenario. It should be clear that patients will be added on back/rear side of the queue and will be served from front of the queue. Further, your program should use Queue as an array to implement above scenario.
Q.No.1:Suppose in a Hospital, there are two physicians to deal
with patients. Patients of all ages come for their checkup. Physician ‘A’ is designated
as physician of old patients while physician ‘B’ has to check other patients.
Many patients come to the hospital at the same time. There are two queues
of patients against each physician. If patient is an old man, he will stand in second
queue; otherwise he will stand in first queue. Both doctors check their patients one by
one on first come first served basis. Due to timing restriction of the hospital, each doctor
can check a maximum of 20 patients per day.
You are required to write a program in C++ to implement the above scenario. It should
be clear that patients will be added on back/rear side of the queue and will be served
from front of the queue. Further, your program should use Queue as an array to
implement above scenario.
Step by step
Solved in 3 steps with 1 images