Question: Write a program that simulates the customers waiting in line at a bank. Use a queue data structure to represent the line. As customers arrive
Write a program that simulates the customers waiting in line at a bank. Use a queue data structure to represent the line.
As customers arrive at the bank, customer objects are put in the rear of the queue with an enqueue operation.
Randomly determine when new customers (1 to 10 customers at a time) arrive at the bank.
When the teller is ready to service a customer, the customer object is removed from the front of the queue with a dequeue operation.
Randomly determine current customers (1 to 10 customers at a time) are servedat the teller window.
In each cycle, print a message when an operation occurs during the simulation.
Repeat above at least 10 times (cycles). When the customers are still in the queue, they must be served(dequeued).
Here's the Queue interface and linked queue
public interface QueueInterface
public final class LinkedQueue
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
