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 are in your class?");
int students = int.Parse(Console.ReadLine());
string [] names = new string [students];
Console.WriteLine("Please type all the students names, and press enter after each one.");
for (int i = 0; i < names.Length; i++)
names [i] = Console.ReadLine();
Console.WriteLine("How many grades will you be entering for each student?");
int amount = int.Parse(Console.ReadLine());
double[ ,] grades = new double [students, amount];
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());
double [] myAvg = arrayAvg(grades);
Console.WriteLine("Here are the grades for these students!");
double [] classAvg = arrayAvg(grades);
for (int i = 0; i < students; i++)
Console.Write(names[i] + ": | ");
for (int j = 0; j < amount; j++)
Console.Write(grades[i ,j] + "| ");
Console.WriteLine(" The Final Average: " + myAvg[i]);
Console.WriteLine("\n_____________________________________________________");
Console.WriteLine("The students here have made Honor Roll!");
for (int i = 0; i < myAvg.Length; i++)
Console.WriteLine(names[i]);
Console.WriteLine("The students here have Failed!");
for (int i = 0; i < myAvg.Length; i++)
Console.WriteLine(names[i]);
Console.WriteLine("These students have Passed!");
for (int i = 0; i < myAvg.Length; i++)
Console.WriteLine(names[i]);