Const MSG_ID_INCORRECT = "ID has incorrect format. ID must be unique and must be between 10,000 and 99,999 inclusive"
Const MSG_RESULT_INCORRECT = "Results need to be between 20 and 100"
Private IDs(NUM_STUDENTS - 1) as integer
Private ENGs(NUM_STUDENTS - 1) as integer
Private SCIs(NUM_STUDENTS - 1) as integer
Private MATs(NUM_STUDENTS - 1) as integer
Private AllArrays()() as integer = {IDS, ENGs, SCIs, MATs}
Console.WriteLine("What Do You Want To Do? Enter 1 To Enter Marks, 2 To Display, 3 To Search Or 4 To Quit: ")
nOption = Console.ReadLine()
If nOption <1 or nOption >4 then
Console.WriteLine("Invalid Input, Make Sure You Chose Either Option 1 Or 4: ")
Elseif nOption = 2 or nOption = 3 then
Console.WriteLine("You Haven't Entered Any Data To Be Displayed Or Searched From! Please Select 1 To Enter Data Or 4 To Quit: ")
Loop Until nOption = 1 or nOption = 4
Console.WriteLine("Ending. Finding Results... ")
Console.WriteLine("The Results Are: ")
For i = 0 to NUM_STUDENTS - 1
Console.writeline(" Enter ID Followed By The Results. The Format is: ID, English Result, Science Result And Maths Result: ")
Dim asIn = sIn.Split(", ")
isvalid = validate_ID(nTemp)
Console.WriteLine("Please re-enter ID: ")
nTemp = Console.readline()
isvalid = validate_ID(nTemp)
isvalid = Validate_Results(nTemp)
Console.WriteLine("Please re-enter Result for English: ")
nTemp = Console.readline()
isvalid = validate_Results(nTemp)
isvalid = Validate_Results(nTemp)
Console.WriteLine("Please re-enter Result for Science: ")
nTemp = Console.readline()
isvalid = validate_Results(nTemp)
isvalid = Validate_Results(nTemp)
Console.WriteLine("Please re-enter Result for Maths: ")
nTemp = Console.readline()
isvalid = validate_Results(nTemp)
Function Validate_Results(nResult as integer) as boolean
Console.writeline(MSG_RESULT_INCORRECT)
Function Validate_ID(nID) as integer
if nID < 9999 OR nID > 99999 then
Console.WriteLine("ID value incorrect. ID needs to be between 10,000 and 99,999. ")
if array.IndexOf(IDs, nID) <> -1 then
Console.WriteLine("ID not unique")
Public Sub PrintArray(the_array as object)
For each s as object in the_array
Console.write("{0} ", s.ToString())
Console.writeline("{0,10}{1,10}{2,10}{3,10}", "ID", "English", "Science", "Maths")
for i as integer = 0 to IDs.Length-1
Console.writeline("{0,10}{1,10}{2,10}{3,10}", IDs(i), ENGs(i), SCIs(i), MATs(i))
anAvg(0) = ntotal / nStudents
anAvg(1) = ntotal / nStudents
anAvg(2) = ntotal / nStudents
console.writeline("{0,-12}{1,-12}{2,-12}{3,-12}", "ID", "English", "Science", "Maths")
console.writeline("{0,-12}{1,-12}{2,-12}{3,-12}", new String("_", 10), new String("_", 10), new String("_", 10), new String("_", 10))
for n as integer = 0 to nStudents - 1
console.WriteLine("{0,-12}{1,-12}{2,-12}{3,-12}", IDs(n), ENGs(n), SCIs(n), MATs(n))
console.writeline("{0,-12}{1,-12}{2,-12}{3,-12}", "Average: ", anAvg(0), anAvg(1), anAvg(2))
dim maxENG, maxSCI, maxMAT as integer
Console.WriteLine("{0, -12}{1, -12}{2, -12}{3, -12}", "Maximum: ", maxENG, maxSCI, maxMAT)
dim minENG, minSCI, minMAT as integer
Console.WriteLine("{0, -12}{1, -12}{2, -12}{3, -12}", "Mininum: ", minENG, minSCI, minMAT)
Public function findMax(num() as integer)
For i = 0 to num.length - 1
Public function findMin(num() as integer)
For i = 0 to num.length - 1