Purchase Solution

C++ Bank Queue Simulation Program

Not what you're looking for?

Ask Custom Question

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

Purchase this Solution

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

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 ...

Purchase this Solution


Free BrainMass Quizzes
Basic UNIX commands

Use this quiz to check your knowledge of a few common UNIX commands. The quiz covers some of the most essential UNIX commands and their basic usage. If you can pass this quiz then you are clearly on your way to becoming an effective UNIX command line user.

Java loops

This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.

Word 2010: Table of Contents

Ever wondered where a Table of Contents in a Word document comes from? Maybe you need a refresher on the topic? This quiz will remind you of the keywords and options used when working with a T.O.C. in Word 2010.

Basic Computer Terms

We use many basic terms like bit, pixel in our usual conversations about computers. Are we aware of what these mean? This little quiz is an attempt towards discovering that.

C# variables and classes

This quiz contains questions about C# classes and variables.