dim candidate(3) as string
dim student(4) as integer
console.writeline("Input candidates names")
candidate(i) = console.readline
console.WriteLine("if there is a third candidate input 1 otherwise input 0")
console.writeline("input third candidate")
candidate(2) = console.readline()
console.WriteLine("if there is a fourth candidate input 1 otherwise input 0")
console.writeline("input fourth candidate")
candidate(3) = console.readline()
console.WriteLine(candidate(i) & " 1 2 3 4")
console.writeline("input score for each candidate 4 being the top score and 1 being the bottom")
console.WriteLine("if there is only 3 candidates use 4, 3 and 2. If there is only 2 use 4 and 3.")
console.WriteLine("vote for " & candidate(0))
student(i) = console.readline
loop until student(i) >= 0 and student(i) <= 4 and student(i) mod 1 = 0
score(1) = score(1) + student(i)
console.WriteLine("vote for " & candidate(1))
student(i) = console.readline
loop until student(i) >= 0 and student(i) <= 4 and student(i) mod 1 = 0
score(2) = score(2) + student(i)
console.WriteLine("vote for " & candidate(2))
student(i) = console.readline
loop until student(i) >= 0 and student(i) <= 4 and student(i) mod 1 = 0
score(3) = score(3) + student(i)
console.WriteLine("vote for " & candidate(3))
student(i) = console.readline
loop until student(i) >= 0 and student(i) <= 4 and student(i) mod 1 = 0
score(4) = score(4) + student(i)
dim maxindex as integer = 0
Dim dLastmax As Decimal = 100000
For j as integer = 0 To score.GetUpperBound(0)
For i as integer = 0 To score.GetUpperBound(0)
If score(i) > dMax And score(i) <= dLastMax Then
score(index)=integer.minvalue