Java代写:CS214 Bank Queue Simulation

练习使用数据结构中的Queue,模拟一个银行的排队场景。

Objective

Create and use queues

Instructions

Develop a java program that simulates the queues in a bank.

Bank Queue Simulation Problem

Implement the event-driven simulation of a bank that this chapter described on pages 434 through 444. 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.

Your program must count the 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 (total number of arrivals and average time spent waiting in line).

Input

In this section, the various input tables are described.

Customer Table

The Customer Table identifies the Customers coming into the bank, the time they arrive and the transactions they wish to perform. Note that a Customer may want to perform multiple transactions.

Transaction NumberCustomer IDArrival TimeTransaction Type
111Transfer
21Deposit
324Withdrawal
42Account Balance
537Account Balance
63Withdrawal
73Deposit
848Withdrawal
959Transfer
10613Transfer

Transaction Type Table

The Transaction Type table identifies the duration for the teller to perform each Transaction Type.

Transaction Type IDTransaction Type DescriptionDuration
1Deposit4
2Withdrawal2
3Transfer3
4Account Balance1

Output

The table below should be output to show the customers arrival time, the time waiting in line and the time they depart. This information should be used to calculate the total number of arrivals and the average wait time.

CustomerArrivedWaiting TimeAt TellerTransaction TimeDeparted
110178
2448311

Submit

Submit the following:

  • Requirements
  • Test Cases
  • UML diagram for the application
  • Text file(s) containing the classes and methods
  • Text file containing the results