private nSize as integer = 2
private IDs(nSize) as string
private engRes(nSize) as integer
private matRes(nSize) as integer
private sciRes(nSize) as integer
console.WriteLine("input, 1 for input, 2 for display, 3 for search, or -1 to quit the program")
dim userOP as integer = console.ReadLine()
do while userOP > 3 or userOP < -1 or userOP = 0
console.WriteLine("invalid input, please re-enter your desired operation")
userOP = console.ReadLine()
console.WriteLine("input option selected")
console.WriteLine("enter data")
dim asIn = sIn.Split(",")
isValid = validate_ID(nTemp)
console.WriteLine("please re-enter ID number")
nTemp = console.ReadLine()
isValid = validate_ID(nTemp)
isValid = validate_result(engRes(i))
console.WriteLine("please re-enter eng result")
engRes(i) = console.ReadLine()
isvalid = validate_result(engRes(i))
isValid = validate_result(matRes(i))
console.WriteLine("please re-enter mat result")
matRes(i) = console.ReadLine()
isValid = validate_result(matRes(i))
isValid = validate_result(sciRes(i))
console.WriteLine("please re-enter sci result")
sciRes(i) = console.ReadLine()
isValid = validate_result(sciRes(i))
public function validate_ID(nID as integer) as boolean
if nID < 9999 OR nID > 99999 then
console.Write("ID value incorrect. ID needs to be between 10,000 and 99,999. ")
public function validate_result(nRES as integer) as boolean
if nRES > 100 or nRES < 0 then
console.Write("result value incorrect. Result needs to be between 0 and 100. ")
if nRES < 20 and nRES > 0 then
console.Write("low score has been changed to 20")
console.WriteLine("display option selected")
dim totalRESeng as integer
totalRESeng = totalRESeng + engRes(i)
avENG = totalRESeng / countENG
dim totalRESmat as integer
totalRESmat = totalRESmat + matRes(i)
avMAT = totalRESmat / countMAT
dim totalRESsci as integer
totalRESsci = totalRESsci + sciRes(i)
avSCI = totalRESsci / countSCI
if engRes(i) > maxENG then
if engRes(i) < minENG then
if matRes(i) > maxMAT then
if matRes(i) < minMAT then
if sciRes(i) > maxSCI then
if sciRes(i) < minSCI then
console.WriteLine("{0, -20} {1, -20} {2, -20} {3, -20}", "student ID", "ENG result", "MAT result", "SCI result")
for i as integer = 0 to nSize
console.WriteLine("{0, -20} {1, -20} {2, -20} {3, -20}", IDs(i), engRes(i), matRes(i), sciRes(i))
console.WriteLine("calculating averages, maximums, and minimums")
console.WriteLine("{0, -30} {1, -30} {2, -30}", "average ENG result", "average MAT result", "average SCI result")
console.WriteLine("{0, -30} {1, -30} {2, -30}", avENG, avMAT, avSCI)
console.WriteLine("{0, -30} {1, -30} {2, -30}", "maximum ENG result", "maximum MAT result", "maximum SCI result")
console.WriteLine("{0, -30} {1, -30} {2, -30}", maxENG, maxMAT, maxSCI)
console.WriteLine("{0, -30} {1, -30} {2, -30}", "minimum ENG result", "minimum MAT result", "minimum SCI result")
console.WriteLine("{0, -30} {1, -30} {2, -30}", minENG, minMAT, minSCI)
console.WriteLine("search option selected")
console.WriteLine("program stopped")