Difference between revisions of "In queue class definition, make use of the IsEmpty method in Show method"
(Created page with "If I understand this correct it would be replace the condition within the if statement in Show, with !IsEmpty.") |
m |
||
Line 1: | Line 1: | ||
If I understand this correct it would be replace the condition within the if statement in Show, with !IsEmpty. | If I understand this correct it would be replace the condition within the if statement in Show, with !IsEmpty. | ||
+ | |||
+ | <syntaxhighlight lang="C#"> | ||
+ | if (!IsEmpty()) | ||
+ | { | ||
+ | Console.WriteLine(); | ||
+ | Console.Write("The contents of the queue are: "); | ||
+ | foreach (var item in Contents) | ||
+ | { | ||
+ | Console.Write(item); | ||
+ | } | ||
+ | Console.WriteLine(); | ||
+ | </syntaxhighlight> |
Revision as of 15:19, 24 May 2018
If I understand this correct it would be replace the condition within the if statement in Show, with !IsEmpty.
if (!IsEmpty())
{
Console.WriteLine();
Console.Write("The contents of the queue are: ");
foreach (var item in Contents)
{
Console.Write(item);
}
Console.WriteLine();