Question: 2 Cashier A cashier is responsible for helping a queue of customers. It serves one customer at a time. Since the simulation is used to

 2 Cashier A cashier is responsible for helping a queue of

customers. It serves one customer at a time. Since the simulation is

2 Cashier A cashier is responsible for helping a queue of customers. It serves one customer at a time. Since the simulation is used to produce statistics, a cashier also memorizes the tota number of customers served, the total amount of time the customers have been waiting, as well as the total number of items served (processed). Make sure you identified instance variables and class variables . The class has a single constructor. It has no parameters. It initializes the instance variables of the cashier The method addCustomer( Customer c ) adds a customer to the rear of its queue. The method int getQueueSize) returns the number of customers currently waiting in line. . The method serveCustomers( int current Time is a key element of the simulation. The method serveCustomers of each cashiers called once for each step of the simulation. The parameter cur- rent Time is used to compute the total amount of time this customer has spent waiting in line. Here is the behaviour of the cashier when serving customers

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!