Question: * In Java * I run a bank and I want the optimal number of bank tellers. I watch my bank for a day. I

*In Java*
I run a bank and I want the optimal number of bank tellers.
I watch my bank for a day. I look at the time when people come in and how long they spend at a teller and I store this data in a text file.
My bank is a typical bank, everyone waits in one line and gets a teller as one becomes available. It is *not* like a supermarket where there are multiple lines for multiple checkouts.
The text file looks like this:
010
020
1030
1560
At time 0, two people entered the bank. One had a transaction that required 10 seconds, another had a transaction that required 20 seconds. At time 10 seconds, someone else entered the bank and had a 30 second transaction.
If we had 1 teller, what would the average wait time be? ~ 6 seconds
If we had 2 tellers, what would the average wait time be? ~ 1.25 seconds
3 tellers: 0 seconds
Write software to read this file and simulate for an arbitrary number of tellers. Calculate the *average* wait time for customers given N-tellers.
Testing output, you should match approximately these values:
1 teller, average wait = ~3700 seconds
2 tellers, average wait = ~1000 seconds
3 tellers, average wait = ~240 seconds
4 tellers, average wait = ~20 seconds
8 tellers, average wait =0 seconds
Hints:
It is valuable to store the pairs of information in a dedicated class. We can then implement a double-ended queue, for example:
Deque inside_customers = new LinkedList<>();
You should create classes representing Customers, Tellers, and likely several objects representing different lines

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!