Dim Candidates as Decimal
Console.WriteLine("Enter the number of candidates.")
Candidates = Console.ReadLine - 1
Do Until Candidates >=1 AND Candidates <= 3 AND Candidates mod 1 = 0
Console.WriteLine("Invalid amount of candidates entered.")
Candidates = Console.ReadLine - 1
Dim Votes(Candidates) as Integer
Dim Names(Candidates) as String
Console.WriteLine("Enter the number of voters.")
Voters = Console.ReadLine - 1
Do Until Voters >=-1 AND Voters <= 29 AND Voters mod 1 = 0
Console.WriteLine("Invalid amount of voters entered.")
Candidates = Console.ReadLine - 1
Console.WriteLine("Enter the name of a candidate.")
Names(i) = Console.ReadLine()
If Names(i) = Names(Check) Then
Do Until Names(i) <> Names(Check)
Console.WriteLine("Invalid name.")
Names(i) = Console.ReadLine()
Console.WriteLine(i + 1 & " " & Names(i))
Console.WriteLine("Enter candidate number to vote for.")
Vote = Console.ReadLine()
Do Until Vote mod 1 = 0 AND Vote >= 1 AND Vote <= Candidates + 1
Console.WriteLine("Invalid vote.")
Vote = Console.ReadLine()
Console.WriteLine("Vote entered for: " & Names(Vote - 1))
Votes(Vote - 1) = Votes(Vote - 1) + 1
Compared = Candidates - 1
For Count = 0 To Candidates
If Votes(i) < Votes(i + 1) Then
Votes(i) = Votes(i) + Votes(i + 1)
Votes(i + 1) = Votes(i) - Votes(i + 1)
Votes(i) = Votes(i) - Votes(i + 1)
Console.WriteLine(Names(i) & " received " & Votes(i) & " votes. ")
If Votes(0) > Votes(1) Then
Console.WriteLine("NEW CLASS CAPTAIN: " & Names(0))
Console.WriteLine("NO OVERALL WINNER.")