public static float[] arrayAvg(float[, ] a)
float[] tempArray = new float[a.GetLength(0)];
for (int i = 0; i < a.GetLength(0); i++)
for (int j = 0; j < a.GetLength(1); j++)
float avg = sum / (a.GetLength(1));
public static void Main()
Console.WriteLine("How many students are in your class?");
int n = int.Parse(Console.ReadLine());
string [ ] students = new string [n];
Console.WriteLine("How many grades would you like to enter for each student?");
int num = int.Parse(Console.ReadLine());
Console.WriteLine("Please enter the name of the students now! ");
for (int i = 0; i < students.Length; i++)
Console.WriteLine("Please enter student number " + q + "'s name" );
students[i] = Console.ReadLine();
float [,] grades = new float[n,num];
for (int i = 0; i < grades.GetLength(0); i++)
for (int j = 0; j < grades.GetLength(1); j++)
Console.WriteLine("Please enter value grade " + w + " for " + students [i]);
grades [i,j] = float.Parse(Console.ReadLine());
Console.WriteLine("Grades");
Console.WriteLine("------------------------------------------------------------------------------------------");
for (int l = 0; l < students.GetLength(0); l++)
for (int i = 0; i< n; i++)
for(int j = 0; j < num; j++)
{Console.Write(grades[i,j] + " | ");
else if (grades[i,j] >= 10 && grades[i,j] < 100)
{Console.Write(grades[i,j] + " | ");
else if (grades[i,j] >= 100)
{Console.Write(grades[i,j] + " | ");
Console.WriteLine("------------------------------------------------------------------------------------------");
float [] myAvg = arrayAvg(grades);
Console.WriteLine("The below students have made Honor Roll");
for (int i = 0; i < myAvg.Length; i++)
Console.WriteLine(students[i]);
Console.WriteLine("The students below have failed");
for (int i = 0; i < myAvg.Length; i++)
Console.WriteLine(students[i]);
Console.WriteLine("The below students have passed");
for (int i = 0; i < myAvg.Length; i++)
Console.WriteLine(students[i]);