Question: in c + + Write a program to help the hospital determine the optimal number of doctors that need to be on duty during a

in c++ Write a program to help the hospital determine the optimal number of doctors that need to be on
duty during a given 24-hour period so the average wait time for all patients that enter the emergency
room during the period is less than or equal to a given target wait time. The hospital ER operates as
follows:
When patients arrive, they are immediately evaluated and given a severity score, 1 through 10,
with the higher numbers being more severe. Assume the evaluation doesnt take any time.
Then the patient is asked to fill out paperwork that takes 5 minutes. Patients with severity 8 or
higher can be seen before the paperwork is complete and will finish the paperwork after the
doctor is done. Paperwork completed after seeing the doctor does not count toward the wait
time.
When a doctor is ready for a new patient, they grab the highest severity person that has also
been waiting the longest.
The wait time starts when the patient arrives at the ER, includes the time spent completing the
paperwork (as described in bullet #2 above) before seeing the doctor, and ends when the doctor
starts seeing the patient.
Assume that for any given severity, the doctor will spend the severity number times 8 minutes
with the patient.
The hospital will always have a minimum of 3 doctors on duty during the 24-hour period.
COSC 2436 S24
4
Input is from a text file where the first line contains a single integer n that indicates the number
of simulation scenarios in the range [1,4] to follow. For each n scenario, the first line contains two
integers e and a, separated by a space, where e is the number of entries in the simulation where [a >
5], is the target maximum wait time for a patient to be seen by a doctor, in minutes. The next e lines
contain a time in 24-hour format, followed by a space and an integer s between [1,10] denoting the
severity of the patient. The entries in a scenario will be in the order patients arrive to the ER in a 24-
hour period between [00:00,23:59].
For each labeled scenario, output to the screen the minimum number of doctors needed to be
on duty so the average wait time for the patients is less than or equal to the target wait time goal,
followed by a space and the word "DOCTORS". Let the user input the file name from the keyboard.
Finally, the program should ask if the user wants to run the program again (Check case). Use a
queue/PQ data structure. Refer to the sample output below.
Sample File
1
85
00:019
00:019
00:013
00:068
11:013
11:158
11:308
23:101
Sample Run:
Enter filename: emergency.txt
S1: 4 DOCTORS
Run Again (Y/N): N
Name the program: ERDoctorsXX.java or ERDoctorsXX.cpp, where XX are your initials

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!