using System;
using System.Collections.Generic;
class QueueSample
{
public static void Main()
{
Queue<string> surfbreakCollection = new Queue<string> ();
surfbreakCollection.Enqueue ("Mavericks");
surfbreakCollection.Enqueue ("Teahupoo");
surfbreakCollection.Enqueue ("Jaws");
surfbreakCollection.Enqueue ("Nazare");
surfbreakCollection.Enqueue ("Cocoa Beach");
// Print the movies in my Queue
Console.WriteLine("Here are the current movies in my Netflix Movie Queue (10/27/2010)");
foreach (string breaks in surfbreakCollection)
{
Console.WriteLine(breaks);
}
// I just finished watching Iron Man 2 ... just send it back
// When NetFlix gets it, they will remove Iron Man 2 from my Queue
// Note that Iron Man was at the top of the Queue, so it deletes it
surfbreakCollection.Dequeue ();
// and my new Queue will look like this
Console.WriteLine("\nMy Netflix Movie Queue after they received it on (10/28/2010)");
foreach (string breaks in surfbreakCollection)
{
Console.WriteLine(breaks);
}
// Print number of current movies in my NetFlix Queue
Console.Write("\nNumber of surf breaks in the surf break Queue: " + surfbreakCollection.Count);
}
}