Console.WriteLine("Input the name of the student #" & i + 1, ".")
stdn(i) = Console.ReadLine()
Console.WriteLine("Input the marks for the 1st Test out of 20.")
mrks1(i) = Console.ReadLine()
If mrks1(i) > 20 or mrks1(i) < 0 Then
Console.WriteLine("The input marks are invalid! Test 1 is only out of 20. Please input the valid marks for Test 1 after the following questions.")
Console.WriteLine("Input the marks for the 2nd Test out of 25.")
mrks2(i) = Console.ReadLine()
If mrks2(i) > 25 or mrks2(i) < 0 Then
Console.WriteLine("The input marks are invalid! Test 2 is only out of 25. Please input the valid marks for Test 2 after the following questions.")
Console.WriteLine("Input the marks for the 3rd Test out of 35.")
mrks3(i) = Console.ReadLine()
If mrks3(i) > 35 or mrks3(i) < 0 Then
Console.WriteLine("The input marks are invalid! Test 3 is only out of 35. Please input the valid marks for Test 3 after the following questions.")
Console.WriteLine("Total marks for each student out of 80.")
tmrks(i) = mrks1(i) + mrks2(i) + mrks3(i)
Console.WriteLine(i + 1 & "." & stdn(i) & ":" & tmrks(i))
Console.WriteLine("The total average of the whole class is " & avg & ".")
Console.WriteLine("The student with the highest score is " & std & " with the total marks of " & top & " out of 80 marks!")