Dim English, Maths, Science as integer()
Dim Student_Amount as integer
Dim English_Average as integer = 0
Dim Maths_Average as integer = 0
Dim Science_Average as integer = 0
Dim unlock as integer = 0
Public function menu(opt as integer)
Console.Writeline("Select an action")
Console.Writeline("(!) - Input results")
Console.Writeline("(2) - Search results")
Console.Writeline("(3) - Output")
Loop until opt = 1 or 2 or 3
Student_Amount = Student_Amount + 1
Redim Preserve ID(Student_Amount)
Redim Preserve English(Student_Amount)
Redim Preserve Maths(Student_Amount)
Redim Preserve Science(Student_Amount)
Console.Writeline("Enter ID, English, Maths, Science")
Dim parts() as string = s.split(",")
parts(n) = Convert.ToInt32(parts(n))
ID(Student_Amount) = Function1(parts(0))
English(Student_Amount) = Function2(parts(1))
Maths(Student_Amount) = Function3(parts(2))
Science(Student_Amount) = Function4(parts(3))
console.Writeline("{0,-10}{1,-10}{2,-10}{3,-10}", "ID", "English", "Maths", "Science")
console.Writeline("{0,-10}{1,-10}{2,-10}{3,-10}", "No result", "No result", "No result", "No result")
Console.WriteLine("{0,-10}{1,-10}{2,-10}{3,-10}", "ID", "English", "Maths", "Science")
For n = 1 to Student_Amount
Console.Writeline("{0,-10}{1,-10}{2,-10}{3,-10}", ID(n), English(n), Maths(n), Science(n))
For n = 1 to Student_Amount
English_Average = English(n) + English_Average
English_Average = English_Average/Student_Amount
Maths_Average = Maths_Average/Student_Amount
Science_Average = Science_Average/Student_Amount
Console.Writeline("{0,-10}{1,-10}{2,-10}{3,-10}", "Average", English_Average, Maths_Average, Science_Average)
Dim English_Max as integer = 0
Dim English_Min as integer = 100
Dim Maths_Max as integer = 0
Dim Maths_Min as integer = 100
Dim Science_Max as integer = 0
Dim Science_Min as integer = 100
For n = 1 to Student_Amount
If English(n) > English_Max then
If English(n) < English_Min then
If Maths(n) > Maths_Max then
If Maths(n) < Maths_Min then
If Science(n) > Science_Max then
If Science(n) < Science_Min then
Console.Writeline("{0,-10}{1,-10}{2,-10}{3,-10}", "Max", English_Max, Maths_Max, Science_Max)
Console.Writeline("{0,-10}{1,-10}{2,-10}{3,-10}", "Min", English_Min, Maths_Min, Science_Min)
Console.Writeline("See you next time")
public function function1(studentID as string)
If studentID.Length <>5 then
Console.Writeline("Invalid ID")
studentID = Console.Readline()
Loop while studentID.length <> 5
public function function2(English as integer)
Dim attempts as integer = 0
Else if English > 100 then
Console.Writeline("Invalid English score")
English = Console.Readline()
Loop while English < 20 or English > 100
public function function3(Maths as integer)
Dim attempts as integer = 0
Console.Writeline("Invalid Maths score")
Maths = Console.Readline()
Loop while Maths < 20 or Maths > 100
public function function4(Science as integer)
Dim attempts as integer = 0
Else if Science > 100 then
Console.Writeline("Invalid Science score")
Science = Console.Readline()
Loop while Science < 20 or Science > 100