public static void Main()
string[] students = {"Alice", "Bob", "Sam", "Jack"};
int[] MathMarks = {10, 15, 99, 2};
int [] ProgMarks = {93, 16, 0, 88};
Console.WriteLine("Select a student from the following: ");
foreach(string student in students)
Console.WriteLine((i) + " " + student);
Console.Write("Selection: ");
int index = int.Parse(Console.ReadLine());
Console.WriteLine("Student Name: " + students[index]);
Console.WriteLine("Student Math Mark: " + MathMarks[index]);
Console.WriteLine("Student Programming Mark: " + ProgMarks[index]);
Console.WriteLine("The Average marks for Maths is: " + AverageMarks(MathMarks).ToString("0.00"));
static double AverageMarks(int[] marks)
for(int j = 0; j < marks.Length; j++)
return (double)sum / marks.Length;