I am stuck at this error for hours, I would appreciate your help. There is two errors:
:) tabulate counts votes when all candidates remain in election
:) tabulate counts votes when one candidate is eliminated
:( tabulate counts votes when multiple candidates are eliminated tabulate function did not produce correct vote totals
:( tabulate handles multiple rounds of preferences tabulate function did not produce correct vote totals
The first one I checked and it did produce the correct vote totals and I do not understand what the second one means. Here is my code:
// Tabulate votes for non-eliminated candidates
void tabulate(void)
{
for (int i = 0; i < voter_count; i++)
{
int j = 0;
for (int z = 0; z < candidate_count; z++)
{
if (preferences[i][j] == z)
{
if (candidates[preferences[i][j]].eliminated == true)
{
(j++);
}
else
{
(candidates[preferences[i][j]].votes++);
break;
}
}
}
}
return;
}