nCands = Input("Enter number of candidates (2 to 4)")
do until nCands >= 2 and nCands <= 4
console.writeline("invalid amount. Enter number of candidates")
nCands = console.readLine()
Dim nVotes(nCands) as integer
Dim sNames(nCands) as String
For i as integer = 0 to nCands
console.WriteLine("Enter name for candidate {0}", i + 1)
sNames(i) = console.readline()
For each name as string in snames
console.writeline("Enter the amount of votes needed")
Dim nMaxVoters as integer = console.readline - 1
For i as integer = 0 to nMaxVoters
Print("Enter the number of the candidate you enter")
Print("Numbers and names follow")
For j as integer = 0 to nCands
Console.writeline("{1, 10} {0}", j + 1, sNames(j))
do until nVote = nCands >= 1 and <= nCands nVote.length -1
console.writeline("invalid candidate. Re-enter the number of the candidate you enter")
nVote = console.readLine()
console.WriteLine("{0,10} {1}", sNames(i), nVotes(i))
For i as integer = 0 to nVotes.Length - 1
For i as integer = 0 to nVotes.length - 1
Console.WriteLine("There is a clear winner")
Console.writeline("The winner is {0} with {1} vote(s)")
Console.WriteLine("There is no clear winner")
For i = 0 to nVotes.Length - 1
Public Sub Print(s as string)
Public Function Input(message as string) as string
return console.readline()