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...
-
Inspect Table 8.6 and identify tool materials that would not be particularly suitable for interrupted cutting operations, such as milling. Explain your choices.
-
Compare and contrast the achievement culture with the involvement culture. What are some possible disadvantages of having a strong involvement culture? A strong achievement culture?
-
North Shore Architectural Stone, Inc., a company that installs limestone in residential and commercial buildings, agreed to supply and install limestone for a property owned by Joseph Vitacco. North...
-
(Pension Expense, Journal Entries for 2 Years) Gordon Company sponsors a defined benefit pension plan. The following information related to the pension plan is available for 2010 and 2011. (a)...
-
In return for an investment of $34318 in a fixed interest security, you will receive $134 at the end of each half year plus your money back on redemption in 12 years. You intend to deposit all the...
-
On May 31, O'Hearne Limited had a cash balance per books of $13,126. The bank statement from Community Bank on that date showed a balance of $15,230. A comparison of the bank statement with the...
-
Buying a New PC New personal computers are widely available directly from manufacturers, as well as in retail, computer, electronic, and warehouse stores. Some stores carry only standard...
-
In the Figure below, the density of fluid 1, p=700 kg/m and the density of fluid 2, p2=950 kg/m In addition, h=0.9 m and h=0.75 m. Assume g=9.81 m/s and Patm = 101.3 kPa. By first writing the...
-
There are two identical wind turbines. The speed ratio of these wind turbines is as given below: Speed of Turbine 1/Speed of Turbine 2 = 1/1.5 What is the ratio of maximum possible power generated by...
-
Which is a characteristic of current liabilities: O Includes obligations payable within one year O Can be satisfied only with the payment of cash O Does not include obligations to taxing authorities...
-
The requirements of GAAP relevant to accounting for income taxes are applicable to O Federal income taxes only. O Federal and state income taxes only. Domestic income taxes only. Federal, state,...
-
Shoppers can rely on fraud protection provided by credit card issuers to protect them from identity theft. O TRUE FALSE 1 point Confidentiality, integrity, and awareness are the three components of...
-
A B D E F 1 2 3 4 5 6 7 8 Account Title 9 Cash DATA SHEET ONLY; No answers entered here! COUGAR MOUNTAIN SPORTS Adjusted Trial Balance June 30, 2024 Balance Debit Credit 152,000 10 Accounts...
-
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,...
-
Determine the solutions of the difference equations below, supposing that the systems they represent are initially relaxed: (a) \(y(n)-\frac{1}{\sqrt{2}} y(n-1)+y(n-2)=2^{-n} \sin \left(\frac{\pi}{4}...
-
Find the general solution for the difference equation in Example 1.9 when \(a=b\). Example 1.9. Solve the difference equation y(n) + ay(n 2) = b" sin(n)u(n) assuming that ab and y(n) = 0, for n < 0....
-
Show that a system described by Equation (1.63) is linear if and only if the auxiliary conditions are zero. Show also that the system is time invariant if the zero auxiliary conditions are defined...
Study smarter with the SolutionInn App