Difference between revisions of "Show"

From TRCCompSci - AQA Computer Science
Jump to: navigation, search
(Created page with "Outputs the contents of the queue instance to the standard console output stream.")
 
Line 1: Line 1:
 +
<syntaxhighlight lang=csharp>
 +
            public void Show()
 +
            {
 +
                if (Rear != -1)
 +
                {
 +
                    Console.WriteLine();
 +
                    Console.Write("The contents of the queue are: ");
 +
                    foreach (var item in Contents)
 +
                    {
 +
                        Console.Write(item);
 +
                    }
 +
                    Console.WriteLine();
 +
                }
 +
            }
 +
</syntaxhighlight>
 
Outputs the contents of the queue instance to the standard console output stream.
 
Outputs the contents of the queue instance to the standard console output stream.

Revision as of 12:45, 14 November 2017

            public void Show()
            {
                if (Rear != -1)
                {
                    Console.WriteLine();
                    Console.Write("The contents of the queue are: ");
                    foreach (var item in Contents)
                    {
                        Console.Write(item);
                    }
                    Console.WriteLine();
                }
            }

Outputs the contents of the queue instance to the standard console output stream.