Implement the event-driven simulation of a bank that this chapter des.docx

  • No School
  • AA 1
  • 3

This preview shows page 1 - 3 out of 3 pages.

Image of page 1
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 an ADT event list, sorted by the time of the event. Use a reference-based implementation for the ADT event list The input is a text file of arrival and transaction times. Each line of the file contains tiie 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 Processing time: 20 28 5 an arrival event at statistics are sufficient to compute the average waiting time after the last event has been processed Processing an arrival event time: 22 30 5 at Display a trace of the events executed and a summary of the computed statistics (total number of Processing an arrival event time: 24 88 at arrivals and average time spent waiting in line). For example, the input
Image of page 2
Image of page 3

You've reached the end of your free preview.

Want to read all 3 pages?

Unformatted text preview: file shown in the left Processing a departure event 25 columns of the following table should produce the output shown in the right column. Input File Output Note: use Java Processingan arrival event at time: 26 Processing an arrival event at time: 28 Simulation Begins 1 5 Processing an arrival event at time: 30 at time Processing an arrival event 2 5 1 Processing a departure event at time: 30 Processing an arrival event at time: 35 Processing an arrival event at time: 4 5 2 Processing an arrival event at time: 40 at time: 20 Processing an arrival event 5 4 Processing an arrival event time: 45 Processing an arrival event at time: 50 22 Processing a departure event at time: 5 6 Processing an arrival event 88 time Processing an arrival event at time: 91 24 Processing a departure event at time: 11 5 Final Statistics Total number of people processed: 10 Processing a departure event at time: 16 5 Average amount of time spent waiting: 5.6 at time: 20 28 5 Processing an arrival event LO 26...
View Full Document

  • Fall '19

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask ( soon) You can ask (will expire )
Answers in as fast as 15 minutes
A+ icon
Ask Expert Tutors