Queues

Problem Statement:
Suppose in a Hospital, there are two physicians to deal with patients. Patients of all ages come for their check up. 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 array to implement above scenario.


Solution Guidelines:
 You are required to implement queue as an array.
 Your solution should contain two classes Patient class and PatientQueue class.
 Patient class should be able to set patients’ information given in above model.
 Further, your program should implement the following operations for PatientQueue class / data structure.
1. Add_Patient() : add new patient in the queue
2. Display_Patient_Phy1() : Show all Patients information treated by Physician A.
3. Display_Patient_Phy2() : Show all Patients information treated by Physician B.
4. Total_Patients() : Show the total number of patients served on a particular day.
 In main() function, you have to create two patient queues; one to store records of old patients, and one to store record of other patients.
 Each queue should be populated based on age factor; for example if age is less than 50, patient should be added in first queue otherwise in second queue.
Hint: Array index should hold Patient type object. In case of integer type array, you store an integer type data on array index. Here, as you have to store patient type data in array (queue), so patient object will be added on array index.


So that is the problem. Now what is the question or thing you are having difficulties with?
Topic archived. No new replies allowed.