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 = 1; j < a.GetLength(1); j++)
double avg = sum / (a.GetLength(1) - 1);
public static void Main()
Console.WriteLine("How many students do you have?");
int numOfStudents = int.Parse(Console.ReadLine());
string[] names = new string[numOfStudents];
Console.WriteLine("Please enter each name pressing enter after.");
for (int i = 0; i < numOfStudents; i++)
names[i] = Console.ReadLine();
for (int i = 0; i < numOfStudents; i++)
Console.Write(" " + names[i]);
Console.WriteLine("How many grades will you be entering per student?");
int numOfGrades = int.Parse(Console.ReadLine());
double[, ] grades = new double[numOfStudents, numOfGrades];
for (int i = 0; i < grades.GetLength(0); i++)
Console.WriteLine("Please enter the grades for " + names[i]);
for (int j = 0; j < grades.GetLength(1); j++)
grades[i, j] = double.Parse(Console.ReadLine());
Console.WriteLine("Your grade book looks like this:");
double[] classAvg = arrayAvg(grades);
for (int i = 0; i < numOfStudents; i++)
Console.Write(names[i] + ":");
for (int j = 0; j < numOfGrades; j++)
Console.Write(grades[i, j] + "| ");
Console.Write(" Final Average: " + classAvg[i]);
Console.WriteLine("\n___________________________________________");