i am trying to get the percentage of votes for each candidate for my program.

votes is an array (with # of votes for each candidate, total is the total number of votes, index shows me how many candidates there are (so i only run the loop "i<index" times), and percents is the initialized array.

this is my method to get each of the percents:Code:`percents = percentages(votes, total, index, percents);`

after printing out the percents, i get 0 for each one.Code:`public static int[] percentages(int votes[], int total, int index, int percents[]) {`

int i = 0;

for (i=0; i<index; i++) {

percents[i] = (votes[i]/total);

}

return percents;

}