Dim classcount as decimal
Dim candidatecount as decimal
Dim CandidateScore(candidatecount) As Decimal
Dim CandidateNames(candidatecount) As String
Console.WriteLine("Enter number of people in the class")
Precheck = Console.ReadLine()
If Precheck >= 2 and precheck <= 30 then
Console.WriteLine("error")
Console.WriteLine("Enter Number of Candidates")
Precheck = Console.ReadLine()
If Precheck >= 2 and precheck <= 4 then
candidatecount = Precheck
Console.WriteLine("error")
For i = 1 To candidatecount
Console.WriteLine("Enter Candidate Name")
CandidateNames(i) = Console.ReadLine()
Console.WriteLine("Input vote. (Number, name)")
For i = 1 To candidatecount
Console.WriteLine(" - " & CandidateNames(i) & " (" & i & ")")
Precheck = Console.ReadLine()
If Precheck = 0 And Precheck > 0 And Precheck <= candidatecount Then
CandidateScore(Precheck) = CandidateScore(Precheck) + 1
Console.WriteLine("Invalid vote")
dim Last As Decimal = 100000
For j = 0 To candidatecount
For i = 1 To candidatecount
If CandidateScore(i) > Max And CandidateScore(i) < Last Then
elseif CandidateScore(i) = Last
Console.WriteLine(CandidateNames(i) & " - Number of Votes: " & CandidateScore(i))
For i = 1 To candidatecount
If CandidateScore(i) >= Max Then
For j = 1 To candidatecount
MaxName = CandidateNames(i)
Console.WriteLine("no overall winner")
Console.WriteLine("new class captain " & MaxName)