Answered step by step
Verified Expert Solution
Link Copied!

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:
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<>();
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

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

Transactions On Large Scale Data And Knowledge Centered Systems Xxiv Special Issue On Database And Expert Systems Applications Lncs 9510

Authors: Abdelkader Hameurlain ,Josef Kung ,Roland Wagner ,Hendrik Decker ,Lenka Lhotska ,Sebastian Link

1st Edition

366249213X, 978-3662492130

More Books

Students also viewed these Databases questions