Implement the event-driven simulation of a bank that this chapter described. A queue of arrival events...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Implement the event-driven simulation of a bank that this chapter described. A queue of arrival events will represent the line of customers in the bank. Maintain the arrival events and departure events in a priority queue, sorted by the time of the event. Use a link-based implementation for the priority queue. The input is a text file of arrival and transaction times. Each line of the file contains the arrival time and required transaction time for a customer. The arrival times are ordered by increasing time. Your program must count customers and keep track of their cumulative waiting time. These statistics are sufficient to compute the average waiting time after the last event has been processed. Display a trace of the events executed and a summary of the computed statistics (the total number of arrivals and average time spent waiting in line). For example, the input file shown in the left columns of the following table should produce the output shown in the right column. Input file Output from processing file on left Simulation Begins Processing an arrival event at time: Processing an arrival event at time: Processing an arrival event at time: Processing a departure event at time: Processing a departure event at time: Processing a departure event at time: 2 2 4 20 22 4 24 26 28 11 16 20 22 Processing an arrival event at time: Processing an arrival event at time: Processing an arrival event at time: Processing a departure event at time: Processing an arrival event at time: Processing an arrival event at time: Processing an arrival event at time: Processing a departure event at time: Processing a departure event at time: Processing a departure event at time: Processing a departure event at time: Processing a departure event at time: Processing an arrival event at time: Processing a departure event at time: Simulation Ends 30 88 24 25 26 28 30 30 35 40 45 50 88 91 5555 555 S53 Implement the event-driven simulation of a bank that this chapter described. A queue of arrival events will represent the line of customers in the bank. Maintain the arrival events and departure events in a priority queue, sorted by the time of the event. Use a link-based implementation for the priority queue. The input is a text file of arrival and transaction times. Each line of the file contains the arrival time and required transaction time for a customer. The arrival times are ordered by increasing time. Your program must count customers and keep track of their cumulative waiting time. These statistics are sufficient to compute the average waiting time after the last event has been processed. Display a trace of the events executed and a summary of the computed statistics (the total number of arrivals and average time spent waiting in line). For example, the input file shown in the left columns of the following table should produce the output shown in the right column. Input file Output from processing file on left Simulation Begins Processing an arrival event at time: Processing an arrival event at time: Processing an arrival event at time: Processing a departure event at time: Processing a departure event at time: Processing a departure event at time: 2 2 4 20 22 4 24 26 28 11 16 20 22 Processing an arrival event at time: Processing an arrival event at time: Processing an arrival event at time: Processing a departure event at time: Processing an arrival event at time: Processing an arrival event at time: Processing an arrival event at time: Processing a departure event at time: Processing a departure event at time: Processing a departure event at time: Processing a departure event at time: Processing a departure event at time: Processing an arrival event at time: Processing a departure event at time: Simulation Ends 30 88 24 25 26 28 30 30 35 40 45 50 88 91 5555 555 S53
Expert Answer:
Answer rating: 100% (QA)
File Eventh Event class announcement ifndef EVENTH Set to EVENTH Enter Enter the string Using namespace std Event Event Custom Charging event type Down on arrival int Unsigned IntTactionTime Public Ev... View the full answer
Related Book For
Economics of Money, Banking and Financial Markets
ISBN: 978-0321598905
9th Edition
Authors: Frederic S. Mishkin
Posted Date:
Students also viewed these programming questions
-
Implement the event-driven simulation of a bank that this chapter described. A queue of arrival events will represent the line of customers in the bank. Maintain the arrival events and departure...
-
A queue of arrival events will represent the line of customers in the bank. Maintain the arrival events and departure events in an ADT event list, sorted by the time of the event. Use a reference ...
-
Suppose that you are the manager of a bank that has $15 million of fixed-rate assets, $30 million of rate-sensitive asset5s, $25 million of fixed-rate liabilities, and $20 million of rate-sensitive...
-
Crystal Cleaners dry cleans industrial clothing. The following excerpt from its PPE Subledger shows the component details regarding the dry cleaning equipment: Calculate depreciation on the dry...
-
Last year Perpetual Plastics Company took an average of 46 days to pay suppliers and 38 days to collect its receivables. The company's average days' sales in inventory was 52 days. What was...
-
Briefly explain in which of the following situations moral hazard is likely to be less of a problem. a. A manager is paid a flat salary of $150,000. b. A manager is paid a salary of $75,000 plus 10%...
-
Why is the current best price to charge for the unsold trees the one at which the price elasticity of demand equals 1? (Assume no disposal costs.)
-
Coldbear Inc., a California corporation, recently entered into two new contracts with clients in Georgia and Utah. In order to service those clients, Coldbear will hire a couple of additional...
-
If you had to choose, which one or two factor(s) do you take away from this video? ( Please explain your position in detail using terminology, referencing material and incorporating personal...
-
Consider the following string of page references 7, 0, 1, 2, 0, 3, 0, 4, 2, 3, 0, 3, 2. Complete a figure similar to Figure 8.14, showing the frame allocation for: a. FIFO (first-in-first-out) b. LRU...
-
Mr. Jones is buying a new washer/dryer for $2599 at Home Depot. There is 8.5% sales tax added to his purchase. He plans to charge this to his Home Depot credit card, which earns 19.5% APR. He wants...
-
Suggest factual, conceptual, procedural, and metacognitive statements for the following: I can process financial data for up to 10 million dollars in revenue sales; Well enough to effectively manage...
-
Part I - Farming Operation - General: Risks specific to both the farming and processing plant operations. In writing this part of the report, please make reference to FDA et al, Food and Agriculture...
-
During their most recent annual review meeting, Magda advised her financial planner that she was upset that her portfolio had dropped from $287,876 to $201,345 since the last time the pair met six...
-
select which is correct The cost of land can include a. purchase price b. back property taxes c. cost of removing exsting buildings d. real estate commissions e. all off the choices are correct
-
When preparing a budget it is important to identify the type of costs. Which type of cost will remain constant in total but will decrease on a per unit bases as more items are produced? Fixed costs...
-
Organizational learning may be described as occurring on three levels: individual, team, and organizational. Is it valid and meaningful to conceptualize team-level learning as a connector between...
-
Suppose that the electrical potential at the point (x, y, z) is E(x, y, z) = x + y - 2z. What is the direction of the acceleration at the point (1,3,2)?
-
How does risk sharing benefit both financial intermediaries and private investors?
-
Francine the Financial Advisor has just given you the following advice: Long-term bonds are a great investment because their interest rate is over 20%. Is Francine necessarily right?
-
If most participants in the stock market do not follow what is happening to the monetary aggregates, prices of common stock will not fully reflect information about them. Is this statement true,...
-
One of the secondary aims of the PreEMPt study was to assess the safety of the prehabilitation exercise programme. A serious adverse event was defined as any adverse event or adverse reaction that...
-
What about the economic benefits of producing accounting information? Do you think it is easier, or harder, to assess the economic benefits of accounting information than to assess the costs of...
-
On Wednesday, Paul bought more wrapping paper for 46 cash. However, it was raining hard for much of the day and sales were slow. After Paul had sold half of his total inventories for 32, he decided...
Study smarter with the SolutionInn App