IUP Computer Science
COSC 110    Spring 2006

Project #4
Emergency Room Efficiency
(Due 27 Mar 06)

UPMC has made an efficiency study of the doctors that work in the emergency rooms of some of its branches.  UPMC wants to find out how its doctors compare to each other in terms of efficiency of treating patients who come into the emergency room.  For each doctor, 15 patients have been randomly selected from those that the doctor treated over the past month.  Each patient was given a difficulty rating (from 1 to 9) based on the nature of the complaint, the nature of the patient, and the "standard" treatment procedures the doctor would be expected to use.  The time that it took the doctor to treat each patient is recorded as a matter of routine for every patient; the time is measured in minutes.  The information for all of the doctors has been collected in a file named efficiency.txt  Each line of the file has the following form:

lastName, firstName    rating#1  time#1  rating#2  time#2  rating#3  time#3  . . .

There are fifteen sets of rating-time pairs.  The actual contents of the file begin like this

Fishhawk, Skyler  5  44 1  24 4  48 3  36 4  60 3  48 1  20 2  40 5  48 and 6 more
Doonesbury, Mike  1  20 1  20 4  36 2  32 7  60 3  52 9  84 8  68 8  76 and 6 more
Canyon, Steve     1  28 4  44 6  56 7  80 5  76 3  60 1  36 2  52 5  60 and 6 more

You are to write a program that does the following:

  1. Calculates the efficiency number for each patient treated.  This is calculated as
       2.0 * time / log (rating + 1)    where log is the natural logarithm.  For example, Skyler Fishhawk's first patient results in a efficiency number of   2*44 / log(5+1)  or  49.114  which is very good.  The lower the efficiency number, the more efficient the doctor is.
  2. Calculates the average efficiency number for each doctor (the average for the 15 patients).
  3. Calculates the worst patient treatment for each doctor (the highest efficiency number that the doctor had for any of his/her 15 patients).
  4. For each doctor, displays the doctor's name (in the form  FirstName LastName with no comma), the average efficiency number for the doctor, and the doctor's worst efficiency number.  This display should show all information in neat columns.  Efficiency information should be shown with three decimal places.  Here is a sample for the first few doctors:

    Doctor                    Average      Worst

  5. Skyler Fishhawk            62.278     86.335
    Mike Doonesbury            59.500     80.791
    Steve Canyon               68.491    103.874

  6. Determine the name of the doctor with the best (lowest) average efficiency number and display this name with that doctor's average.
  7. Determine the name of the doctor with the overall worst single patient treatment (highest single patient efficiency number) and display the name and the worst efficiency number for that doctor.
  8. Determine and display the average efficiency number for all doctors, all patients combined.
Actions #1, #2, and #3 must be performed in a void function named EvaluateDoctor.  The function may perform additional actions; but it must do #1, #2, and #3 for one doctor.  This will make it possible to invoke EvaluateDoctor for each doctor.

The efficiency.txt file can be found on the I: drive at I:\jlwolfe\110\efficiency.txt or on the P: drive at P:\courses\spring2006\cosc\cosc110\00X\information\efficiency.txt  (where the X is a 2 or a 3).

Make sure all program output is clearly labeled.  Hand in a printout of your well-documented program and a screen capture of the output from the program's execution.  Then, copy the .cpp file for the program to the hand-in folder on the P: drive.  Be sure to name the .cpp file after yourself; for example, I might name my file p4-wolfe.cpp