Question
Banking simulation in Java You are tasked to write a simulation of a bank to have the optimum number of tellers. The bank wants to
Banking simulation in Java
You are tasked to write a simulation of a bank to have the optimum number of tellers.
The bank wants to have only the smallest number of tellers on hand to be able to satisfy the customers.
For instance, if they only have 2 tellers the wait times might be too long and customers will complain of bad service.
If they hire 20 tellers the wait times might not be any different that if they had 8 and are wasting money.
Customers will come in at different time and sometimes multiple customers will come in at the same time.
When a customer comes in they will choose the smallest line that is available. Also, each customer will have some time associated with their transaction.
At the end of the simulation print out the average process time for 2 tellers all the way up to 10 tellers.
The process time includes waiting in line plus the amount of time of the transaction.
There are several ways to create this simulation. One creates an array of linked lists, where the list will contain the customers. When a new customer enters place them on the smallest list. Another way is to read in all the customers and place them on a central line and take one when the time is appropriate.
Each loop of the simulation will be of time 1. At each iteration, see if there is a customer entering the bank. If so assign them a teller. The see if each teller has a customer. If so decrement the amount of time the customer has for transaction. If it is zero process them out. Calculate the process time. (current_time arrival_time) + transaction_time
Add it the running total. Repeat until no customers are present.
Average process time is the running total / # of customers processed.
Repeat with +1 tellers until you done all possibilities including 10 tellers.
Print out all the teller simulations
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