Explore BrainMass

C++ Bank Queue Simulation Program

Customers walking into a bank are placed in a queue based on an arrival time distribution. Each customer has:
1. Customer number
2. Arrival time
3. Waiting time
4. Transaction time

The transaction time is based on what a customer decides to do, which can be one of the following:

1. Open a Certificate of Deposit (15 min)
2. Open a checking account (20 min)
3. Open a savings account (25 min)
4. Close checking account (15 min)
5. Closing savings account (17 min)

- The Server removes a customer from the queue then generates a random number between 1 and 5 to simulate a transaction type i.e. Open a checking account etc.
- The Server then sleeps for the duration of the transaction and then writes the customer information to a file.
- Waiting time is the difference between the arrival time and simulation time

© BrainMass Inc. brainmass.com June 24, 2018, 1:02 pm ad1c9bdddf


Solution Preview

Please find attached C++ file with the code simulating bank queue. Note that for the simulation program I have set sleep operation whilst customer is being processed to be in milliseconds instead of minutes, so as to get the results faster. If you would want to put real minutes you would need to increase the factor from 100 to 60000. I have placed a comment there. The output file ...

Solution Summary

Solution contains C++ file with the source code simulating bank queue. The queue is processed with specified time delays. The results are displayed as output to the console in the following format as an example:

Time: 30 Customer C3 Arrived at:18 Waiting Time:12 Operation: 'Close Checking Account' Transaction Time:15
Time: 45 Customer C4 Arrived at:22 Waiting Time:23 Operation: 'Close Checking Account' Transaction Time:15
Time: 60 Customer C5 Arrived at:23 Waiting Time:37 Operation: 'Open Savings Account' Transaction Time:25
Time: 85 Customer C6 Arrived at:27 Waiting Time:58 Operation: 'Close Checking Account' Transaction Time:15