Question: Using the STL class, write a C++ program that simulates a visit to the doctor's office. You can make the following assumptions: 1. Patients arrive

Using the STL class, write a C++ program that simulates a visit to the doctor's office. You can make the following assumptions:

1. Patients arrive at the doctor's office one at a time and are served one at a time, in the order of arrival. 2. The doctor does not plan to not be in his office for more than 1 hour, but will stay if there are patients waiting and remain there until no more patients are waiting. Model an hour as a minute in your program. 3. The arrival rate is a random number, but no new arrivals can arrive after 1 hour (1 minute in the program) has passed. 4. The service rate is a random number in minutes (seconds in your program). You can assume this number is the data value in each student (queue item) which pauses the professor from popping the next student from the queue for that duration.

Run the program 100 times using a loop and find the following:

1. The average time a patient spends waiting during a doctor's office visit 2. The average time a patient spends with the doctor during a doctor's office visit 3. The average time a doctor spends at his office beyond the 1 hour he intends to

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 Databases Questions!