Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

Start Program Proposed Solution/ Algorithm for Problem 1: Determining the minimum number of bank tellers

Submitted by: Gwen Bess N. Cacanindin

Because there are no fixed transaction times and arrival times per customer, random number generators are used for
these variables. The manager will input their expected number of customers per day and the number of tellers they
Get
wish to test.
expected
no. of
The program will not directly tell the manager how many tellers they should hire but will simulate how the day will go,
customers
with the number of tellers to test on the expected number of customers. The manager can then compare the output
average waiting times and idle times with each different number of tellers. The program will help the manager
determine the minimum number of tellers their bank needs in order to maintain reasonable waiting times per
customer.

Get no. Variables:


of tellers Arrival Time (AT) - any time within the 8-hour working day that a customer arrives
Transaction Time (TT) - the predicted time a customer will need for their transaction
Idle Time (IT) - the time a teller is not busy serving a customer
The initial values for the counters i, and n are set to 0.

The flowchart will present the algorithm.

Add [(AT of
Generate Generate Take
customer i)
arrival time transaction customer i
- 800] to list
for all time for to idle
of idle time.
customers. customer i teller. *The bank opens at
8am

Stop idle
Take
time of idle
customer i
teller and
to idle
Y add to list
teller.
of idle time.

Are there Y Is waiting


any idle queue
tellers? empty? Stop waiting
time of Take
dequeued dequeued
and add to to idle
N list of waiting teller.
N
time.

Enqueue
customer i
to waiting Enqueue Start
queue. Dequeue
customer i waiting
the waiting
to waiting time for
queue
queue. customer i.

Start
waiting
time for
customer i.

Let j=(AT of Is [(TT of Is n less


Y Start idle N
customer i) - customer in teller Set teller than
time for
(AT of n) - j] less than or n to idle number
equal 0? teller n.
customer i-1) of tellers?

TT of customer
Set teller in teller n = (TT
of customer in n=n+1
n to busy
teller n) - j

Add j to Add j to
idle times wait times
n=0
of idle of waiting
queue queue

i=i+1

Add
Is i less
remaining Output
than the Compute Compute Output
N hours of the average
Y expected average average average
day to idle waiting
no. of waiting time idle time idle time.
time of time.
customers?
tellers.

End Program

You might also like