16-page9 - int [ ] cashierTime = new int[MAX_CASHIERS]; int...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
The TicketCounter Class • Single program tests varying numbers of cashiers with the same assumptions each time. Departure time is arrival + 120 if cashier is free, otherwise time cashier is done + 120. public class TicketCounter { public static void main (String [ ] args) { // constants: process time, max # cashiers, # customers Customer customer; QueueADT<Customer> cq = new LinkedQueue<Customer> ( );
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: int [ ] cashierTime = new int[MAX_CASHIERS]; int totalTime, averageTime, departs; for (int cashiers=0; cashiers &lt; MAX_CASHIERS; count++) { // set up array, load cq with Customer (count*15) while (!cq.isEmpty( )) { for (int count=0; count &lt; cashiers; count++) { // assign next customer to next cashier, find // their resulting departure time, record it...
View Full Document

Ask a homework question - tutors are online