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.
![D Page view A Read aloud V Draw
E Highlight
O Erase
of 7
Sample 1:
9
ADD Roddy Good
ADD Celine Fair
ADD Berry Good
CALL
Celine is in the Consultation Room
ADD Ronny Critical
ADD Belany Serious
CALL
Ronny is in the Emergency Room
CALL
Belany is in the Examination Room
CALL
Roddy is in the Consultation Room
Waiting Room: Berry
Process exited after 0.05033 seconds with return value e
Press anykey to continue . .
Sample 2:
ADD Roddy Good
ADD Celine Fair
ADD Ronny Critical
ADD Belany Serious
CALL
Ronny is in the Emergency Room
CALL
Belany is in the Examination Room
Waiting Room: Celine, Berry
Process exited after 0.04427 seconds with return value e
Press any key to continue . . .](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F65911122-c10c-4724-b40a-dca900f377e0%2F0a75fc48-b2d4-401f-81ed-7bdc7e92c584%2F65dqijo_processed.png&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Step by step
Solved in 2 steps with 1 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)