Customers in One Queue
Customers in One Queue
The diagram shows five customers in a queue. The first customer in the
queue is being served. You are going to run a simulation and collect data C C C C C
about the time it takes to serve these customers.
The driver prompts the user to enter the duration of the simulation. Customers randomly arrive and join the
queue. After the duration is finished, no more customers are allowed in, but all the customers already in the
queue will be served.
constructor?
instance methods?
Note that the queue could be empty! You will have to deal with that in your code.
The user entered 15 minutes for the simulation below. The chance of a customer arriving in each minute was
0.3. Each customer, when they arrived, was assigned a random number between 2 and 7 for the time they had
to spend at the front of the queue being served.