Answered step by step
Verified Expert Solution
Question
1 Approved Answer
* Java * I run a bank and I want the optimal number of bank tellers. I watch my bank for a day. I look
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:
At time two people entered the bank. One had a transaction that required seconds, another had a transaction that required seconds. At time seconds, someone else entered the bank and had a second transaction.
If we had teller, what would the average wait time be ~ seconds
If we had tellers, what would the average wait time be ~ seconds
tellers: seconds
Write software to read this file and simulate for an arbitrary number of tellers. Calculate the average wait time for customers given Ntellers.
Testing output, you should match approximately these values:
teller, average wait ~ seconds
tellers, average wait ~ seconds
tellers, average wait ~ seconds
tellers, average wait ~ seconds
tellers, average wait seconds
Hints:
It is valuable to store the pairs of information in a dedicated class. We can then implement a doubleended queue, for example:
Deque insidecustomers new LinkedList;
Tellers can also be done this way, but since they have only a remaining transaction time they can be implemented as a simple array.
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started