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 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, through
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 minutes. Patients with severity 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 # 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 minutes
with the patient.
The hospital will always have a minimum of doctors on duty during the hour period.
COSC S
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 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
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 hour format, followed by a space and an integer s between denoting the
severity of the patient. The entries in a scenario will be in the order patients arrive to the ER in a
hour period between ::
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
queuePQ data structure. Refer to the sample output below.
Sample File
:
:
:
:
:
:
:
:
Sample Run:
Enter filename: emergency.txt
S: DOCTORS
Run Again YN: 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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
