DisplayTargets Flashcards
1
Q
What is the purpose of the foreach loop?
foreach (int T in Targets)
{
if (T == -1)
{
Console.Write(“ “);
}
else
{
Console.Write(T);
}
A
Iterates through all targets, printing -1 as a blank space to indicate a cleared target.
Visually helps the user see which targets remain in a queue-like format.