Question
Book: Data Abstraction & Problem Solving with C++ (7th Edition) Chapter: 13, Problem: 6. Helping Guide for this problem: https://drive.google.com/open?id=1oPMw1fXf8sM7rhMmNviOLSeZzEK3Fqj5 Chegg's Incomplete Solution: https://www.chegg.com/homework-help/data-abstraction-and-problem-solving-with-c-7th-edition-chapter-13-problem-6pp-solution-9780134463971 Provided
Book: Data Abstraction & Problem Solving with C++ (7th Edition) Chapter: 13, Problem: 6. Helping Guide for this problem: https://drive.google.com/open?id=1oPMw1fXf8sM7rhMmNviOLSeZzEK3Fqj5 Chegg's Incomplete Solution: https://www.chegg.com/homework-help/data-abstraction-and-problem-solving-with-c-7th-edition-chapter-13-problem-6pp-solution-9780134463971 Provided Header and CPP files: https://drive.google.com/open?id=1m2xri-O5tHDzpaKQUi8-tmtR1Dy6gGYg
I believe I have provided all the files information to solve this question. I just need the solution done like in Chegg.
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. 6. 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 6 Processing a departure event at time 11 Processing a departure event at time 16 Processing an arrival event at time 20 Processing an arrival event at time 22 Processing an arrival event at time 24 Processing a departure event at time 25 Processing an arrival event at time 26 Processing an arrival event at time 28 Processing an arrival event at time 30 Processing a departure event at time 30 Processing a departure event at time: 35 Processing a departure event at time 40 Processing a departure event at time 45 Processing a departure event at time 50 Processing an arrival event at time 88 Processing a departure event at time 91 Simulation Ends 4 20 2 4 24 26 28 30 Final Statistics: Total number of people processed 10 Average amount of time spent waiting: 5.6 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. 6. 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 6 Processing a departure event at time 11 Processing a departure event at time 16 Processing an arrival event at time 20 Processing an arrival event at time 22 Processing an arrival event at time 24 Processing a departure event at time 25 Processing an arrival event at time 26 Processing an arrival event at time 28 Processing an arrival event at time 30 Processing a departure event at time 30 Processing a departure event at time: 35 Processing a departure event at time 40 Processing a departure event at time 45 Processing a departure event at time 50 Processing an arrival event at time 88 Processing a departure event at time 91 Simulation Ends 4 20 2 4 24 26 28 30 Final Statistics: Total number of people processed 10 Average amount of time spent waiting: 5.6Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started