public static double[] arrayAvg(double[, ] a)
double[] tempArray = new double[a.GetLength(0)];
for (int i = 0; i < a.GetLength(0); i++)
for (int j = 0; j < a.GetLength(1); j++)
double avg = sum / (a.GetLength(1));
public static void Main()
Console.WriteLine("How many students do you have?");
int students = int.Parse(Console.ReadLine());
Console.WriteLine("Now, enter your students names.");
string[] names = new string[students];
for (int i = 0; i < students; i++)
names[i] = Console.ReadLine();
Console.WriteLine("How many grades per student will you have?");
int numberofgrades = int.Parse(Console.ReadLine());
double[, ] grades = new double[names.Length, numberofgrades];
for (int i = 0; i < grades.GetLength(0); i++)
Console.WriteLine("Please enter the grades in for " + names[i]);
for (int j = 0; j < grades.GetLength(1); j++)
grades[i, j] = double.Parse(Console.ReadLine());
double[] average = arrayAvg(grades);
Console.WriteLine("This is what your gradebook will look like:");
for (int i = 0; i < students; i++)
Console.Write(names[i] + "| ");
Console.WriteLine("Final average: " + average[i]);
for (int j = 0; j < numberofgrades; j++)
Console.Write(grades[i, j] + "| ");
for (int i = 0; i < students; i++)
Console.Write(names[i] + " failed.");
else if (average[i] > 90)
Console.WriteLine(names[i] + " is on the Honor Role.");