Challenge #2

A bank manager wishes to run a “Queue Simulation” to determine the optimal number of cashiers to employ – too many cashiers costs too much money, while too few cashiers means dissatisfied customers needing to wait a long time. The C++ STL Queue library should be used to manage the simulation.

Initial Settings

N = 180 (Number of minutes for simulation)
MinCus = 30 (Minimum number of customers)
MaxCus = 100 (Maximum number of customers)
MinServ = 2 (Minimum service time for customer)
MaxServ = 15 (Maximum service time for customer)
Cashiers = 1 (Number of Cashiers)

Each customer has a random arrival time between 0 and 180. These customers should be sorted and then added to a queue when they arrive at the bank. If a cashier is available they can serve the customer.

Your job is to write a simulation. An example of the output for each customer could be:-

Customer #1 – Arrival Time 1 – Wait Time 0 – Service Time 8 – Departure Time 9
Customer #2 – Arrival Time 4 – Wait Time 5 – Service Time 3 – Departure Time 12

An example of a summary for the simulation could be:-

Number of cashiers – XX
Number of customers – XX
Average Service time – XX
Average wait time – XX
Customers at end of simulation – XX

Allow the bank manager to adjust the initial settings to run simulations for different branches of the bank.