Queue Simulation
<p>Hi im trying to simulate a waiting queue by using Java. What my program must consist of:</p>

<ul>
<li>The user input nth number of cashiers</li>
<li>There minimum of 10 customers will arrive in the queue in random intervals.</li>
<li>When a cashier is free the the next customer is line will be processed.</li>
<li>The program must output each stage of the queue as well as the time each customer spent in the queue.</li>
</ul>

<p>Oki so what I have so is a empty queue object, a random string list generator which sends the strings to the queue.</p>

<p>However what problems im having is the random string generator is picking duplicates in the loop, how do I fix this ? 
Also how do I make it send the customers to the queue in intervals of 0.5 sec and I need to record the time they enter the queue and leave the queue so then I can output the time spent in the queue. Im stuck dont know what to do now ?</p>

<pre><code>public static Queue&lt;String&gt; line = new  LinkedList&lt;String&gt; ();

public static void main(String[] args) 
{
    String[] list = {"a", "b", "c", "e", "f", "g", "h", "i", "j", "k", };
    int customer = list.length;

    for (int x = 0; x &lt; customer; x++ )
    {
      int cus = (int) (Math.random() * customer);
      line.add(list[cus]);
    }
}
</code></pre>
