// Naomi Jones
// Survey, Summer 2025
// July 6, 2025
// Assignment 6 - 4 C# Queue
using System;
using System.Collections.Generic;
class QueueSample
{
public static void Main()
{
// Creates a queue of strings that holds operas.
Queue<string> operaCollection = new Queue<string> ();
// Adds operas to the queue.
operaCollection.Enqueue ("Don Giovanni");
operaCollection.Enqueue ("Un Ballo in Maschera");
operaCollection.Enqueue ("Aida");
operaCollection.Enqueue ("Der fliegende Hollander");
operaCollection.Enqueue ("Gotterdammerung");
operaCollection.Enqueue ("Turandot");
// Print the operas in the queue.
Console.WriteLine("Operas in my Spotify queue on 7/5/2025: ");
foreach (string opera in operaCollection)
{
Console.WriteLine(opera);
}
// We listened to Don Giovanni on 07/05/2025 - removed from the queue.
operaCollection.Dequeue ();
// Current queue looks like this on 07/06/2025.
Console.WriteLine("\nOperas left in my Spotify queue on 7/6/2025 after listening to Don Giovanni:");
foreach (string opera in operaCollection)
{
Console.WriteLine(opera);
}
// Print number of remaining operas in my Spotify queue.
Console.WriteLine("\nNumber of operas in my Spotify queue on 7/6/2025 " + operaCollection.Count);
// Prints opera next in the queue.
Console.WriteLine("\nThe next opera in my Spotify queue on 7/5/2025 is " + operaCollection.Peek());
} // main
} // QueueSample class