<% 'find which is the largest number of votes Dim mostvotes mostvotes = 0 For i = 1 to 8 If mostvotes < votes(i) Then mostvotes = votes(i) End If Next 'calculate the total number of votes Dim totalvotes totalvotes = 0 For i = 1 to 8 totalvotes = totalvotes + votes(i) Next %>
<% Response.Write(question) %>
<% For i = 1 to 8 If responses(i) <> "" Then %> <% End If Next %>
<% Response.Write(responses(i)) %>
<% If votes(i) <> 0 Then %>  <% Response.Write(Round((votes(i) / totalvotes * 100),0) & "%") Else %> 0% <% End If %>
Total number of votes: <% Response.Write(totalvotes) %>