Private inpENG(tempnum), inpMAT(tempnum), inpSCI(tempnum) as integer
Private inpID(tempnum) as integer
Console.WriteLine("Type a number for option to do: 1. Input, 2. Display, 3.Search, 4.Quit")
inpOption = Console.ReadLine()
else if inpOption = 2 then
else if inpOption = 3 then
else if inpOption = 4 then
Console.WriteLine("Enter student data in this format: ID, ENG, MAT, SCI; separated with commas in between")
TESTINPUT = Console.ReadLine()
Dim inpSPLIT = TESTINPUT.split(",")
Console.writeline("please input the correct ID")
ntemp = console.ReadLine()
dim validResults as boolean
validResults = ValidSub(ntemp)
do while validresults = false
Console.WriteLine("please input the correct result for ENG")
ntemp = console.ReadLine()
ValidResults = Validsub(ntemp)
validResults = Validsub(ntemp)
do while validresults = false
Console.WriteLine("please input the correct result for MAT")
ntemp = console.ReadLine()
ValidResults = Validsub(ntemp)
validResults = Validsub(ntemp)
do while validresults = false
Console.WriteLine("please input the correct result for MAT")
ntemp = console.ReadLine()
ValidResults = Validsub(ntemp)
Public function ValidID(id as integer) as boolean
if ID < 9999 or ID > 99999 then
if array.Indexof(inpID, ID) = -1 then
console.WriteLine("ID is not unique")
Public function ValidSub(Subject as integer) as boolean
dim catagory() as string = {"UserID", "English_Result", "Math_Result", "Science_Result"}
for i as integer = 0 to catagory.length - 1
Console.Write("{0,-20}", catagory(i))
For i as integer = 0 to tempnum - 1
Console.WriteLine("{0, -20}{1, -20}{2, -20}{3, -20}", inpID(i), inpENG(i), inpMAT(i), inpSCI(i))
dim AvgENG, AvgMAT, AvgSCI as integer
AvgEng = findAverage(inpeng)
AvgMAT = findaverage(inpmat)
AvgSCI = findaverage(inpsci)
Console.WriteLine("{0, -20}{1, -20}{2, -20}{3, -20}", "Average (2sf)", AvgEng, AvgMat, AvgSCI)
dim maxENG, maxMat, maxSCI as integer
Console.WriteLine("{0, -20}{1, -20}{2, -20}{3, -20}", "Maximum", maxEng, maxMat, maxSci)
dim minENG, minMAT, minSCI as integer
Console.WriteLine("{0, -20}{1, -20}{2, -20}{3, -20}", "Mininum", minEng, minMat, minSci)
Public function findAverage(num() as integer)
dim numTot, Avg as integer
for i = 0 to num.length - 1
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