I am trying to do my homework on Array and passing through reference in the Main Method. For some reason my array from the InputData is not passing through the Main Method. Can someone help me with this and I'm getting a red line underneath my InputData in the main method. This is what I have so far...
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace iLab5A
{
class Program
{
public static void Main(string[] args)
{
//declare and initialized variables
double [] scoresArray = new double[100];
string[] playersArray = new string[100];
char reloop = 'Y';
do
{
//initializing Arrays
double averageScore = 0;
double belowAverage = 0;
int numbers = 0;
InputData(ref double scoreArrays, string [] playersArray, int Count);
DisplayPlayerData();
CalculateAverageScore();
DisplayBelowAverage();
reloop = Convert.ToChar(Console.ReadLine());
reloop = char.ToUpper(reloop);
} while (reloop != 'Y');
}
public static void InputData(ref double [] scoresArray, ref string [] playersArray, int Count)
{
while (playersArray.Length <= 100)
{
Console.Write("Please enter the Player's Name: " + "((Q to Quit)) ");
playersArray[Count] = Console.ReadLine();
if (playersArray[Count] == "Q" || playersArray[Count] == "q" )
{
break;
}
Console.Write("Please enter " +playersArray[Count]+ " scores:");
scoresArray[Count] =Convert.ToDouble(Console.ReadLine());
Count++;
}