Write a Java application to manage queues in a bank office. Assume that
there is a single type of operation (ie. single queue), two queue ticket machines (i.e. producers), and n bank officers (i.e. consumers). Implement your producer and consumer threads to use random arrival interval and service time. Averages of arrival interval and service time, in addition to number of officers must be given as command line arguments, so that you can change these to see how system performs under different scenarios.
Your application must be able to report average waiting time to newcomers taking a queue no ticket. The main thread should report every second the status of queue and average waiting time. (Hint: An advisable way to maintain running average of waiting time could be using exponential averages.)
To simplify the problem assume that the queue size is not limited and ticket numbers are not cyclic. i.e. the machines can issue tickets starting from 1 and goes up, without turning back to 1 as common in the actual bank applications.

how can i provide random arrival interval for thread.does thread work randomly ?
random service time ?
average waiting time by main thread
How can i provide mainn thread report average waiting time

Add a code snippet to your website: www.paste.org