Hospital XX has a program to manage patient queues with the following criteria: 1. Queue priority is set based on the patient’s condition in the following order: Critical > Serious > Fair > Good 2. If the patient has the same condition then First In First Served 3. There are two types of events: ADD and CALL 4. ADD to insert patient to the queue 5. CALL to move the patient into the room based on condition: a. If patient in “Critical” Condition then move to Emergency Room b. If patient in “Serious” Condition then move to the Examination Room c. If patient in “Fair” or “Good” Condition move to the Consultation Room Try implementing Double Linked List into the Hospital XX program using C FORMAT INPUT The first line contains an integer N events. Each event containsthree variables String C1, String C2, String C3. String C1 with format “C1 C2 C3” FORMAT OUTPUT If “CALL” is triggered then 1. If patient in “Critical” Condition then the output format will be : “C2 is in the Emergency Room” 2. If patient in “Serious” Condition then the output format w
Hospital XX has a program to manage patient queues with the following criteria:
1. Queue priority is set based on the patient’s condition in the following order: Critical > Serious > Fair
> Good
2. If the patient has the same condition then First In First Served
3. There are two types of events: ADD and CALL
4. ADD to insert patient to the queue
5. CALL to move the patient into the room based on condition:
a. If patient in “Critical” Condition then move to Emergency Room
b. If patient in “Serious” Condition then move to the Examination Room
c. If patient in “Fair” or “Good” Condition move to the Consultation Room
Try implementing Double Linked List into the Hospital XX program using C
FORMAT INPUT
The first line contains an integer N events. Each event containsthree variables String C1, String C2, String
C3. String C1 with format “C1 C2 C3”
FORMAT OUTPUT
If “CALL” is triggered then
1. If patient in “Critical” Condition then the output format will be : “C2 is in the Emergency Room”
2. If patient in “Serious” Condition then the output format will be : “C2 is in the Examination Room”
3. If patient in “Fair” or “Good” Condition then the output format will be : “C2 is in the Consultation
Room”
Print the remaining patients in Waiting Room. If there is no patient then print None
CONSTRAINTS
1≤N≤100
C1 will contain “ADD” or “CALL”
3≤|C2|≤30
C3 will contain “Good”,”Fair”,”Serious” or “Critical”
PLEASE HELP SIR, I NEED THE ANSWER IN ONE HOUR, THX. PLEASE SIR.
Step by step
Solved in 2 steps with 1 images