I am trying to display an array which by itself is no issue. However, I want to add an If statement, so that if the current iteration of the score[] array that is being displayed is equal to 300 then it will put a * after it. Something like 300*
Also the array needs to display highest to lowest which I am doing by reversing the display at the moment it is in the array as lowest to highest. I was thinking about using a swap to reverse the order but if I don't have to then I would like to solve it this way.
So far I am getting
400
332
300*
300
or in another way I tried, I got
0
0
300*
300
250
221
I am just having issue with display and output.
static void Output(int iteration, int[] score, string[] player, double average)
{ //opening output
Console.WriteLine("\n\t****** OUTPUT ******");
Console.WriteLine("\nScores for this game.\n");
if (score[iteration - 1] == 300)
{
Console.WriteLine("{0} score was {1}*", player[iteration - 1], score[iteration - 1]);
}
for (int i = iteration; i <= MAX_SIZE_ARRAY; i--)
{
//iterates through the loop to display all the players name then score
Console.WriteLine("{0} score was {1}", player[i], score[i]);
}
//displays high, low, and average score
Console.WriteLine("\nThe high score was {0} with {1} points", player[iteration - 1], score[iteration - 1]);
Console.WriteLine("The low score was {0} with {1} points", player[0], score[0]);
Console.WriteLine("The team average score was {0}", average);
}
}
}