fork download
  1. // Naomi Jones
  2. // Survey, Summer 2025
  3. // July 6, 2025
  4. // Assignment 6 - 4 C# Queue
  5.  
  6. using System;
  7. using System.Collections.Generic;
  8.  
  9. class QueueSample
  10. {
  11. public static void Main()
  12. {
  13. // Creates a queue of strings that holds operas.
  14. Queue<string> operaCollection = new Queue<string> ();
  15.  
  16. // Adds operas to the queue.
  17. operaCollection.Enqueue ("Don Giovanni");
  18. operaCollection.Enqueue ("Un Ballo in Maschera");
  19. operaCollection.Enqueue ("Aida");
  20. operaCollection.Enqueue ("Der fliegende Holländer");
  21. operaCollection.Enqueue ("Gotterdammerung");
  22. operaCollection.Enqueue ("Turandot");
  23.  
  24. // Print the operas in the queue.
  25. Console.WriteLine("Here are the current operas in my Spotify queue (07/06/2025)");
  26. foreach (string opera in operaCollection)
  27. {
  28. Console.WriteLine(opera);
  29. }
  30.  
  31. } // main
  32.  
  33. } // QueueSample class
  34.  
Success #stdin #stdout 0.06s 28888KB
stdin
Standard input is empty
stdout
Here are the current operas in my Spotify queue (07/06/2025)
Don Giovanni
Un Ballo in Maschera
Aida
Der fliegende Holländer
Gotterdammerung
Turandot