Question: Use your queue implementation to simulate a bank with 3 tellers and one line. The time between arrival of customers is a random integer between

Use your queue implementation to simulate a bank with 3 tellers and one line. The time between arrival of customers is a random integer between 1 and 5. When a customer arrives, the customer gets in line. When any of the three tellers is available, the first customer in line goes to that teller. The time to process that customer's transaction is another random integer between 1 and 5.

When the transaction is completed, the customer leaves. Run the simulation for 100 customers. Report the average time the customer waits in the queue. To do this, for each item enqueue, include its time. For each item dequeued, calculate the current time the time entering the queue.

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!