Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Temporal Databases Research And Practice Lncs 1399

Authors: Opher Etzion ,Sushil Jajodia ,Suryanarayana Sripada

1st Edition

3540645195, 978-3540645191

Students also viewed these Databases questions

Question

2. What process will you put in place to address conflicts?

Answered: 1 week ago