You're trying to compute the average before you've calculated the sums. Also, for each employee you need to reset the averageFeedBack variable so their feedback is calculated independent of everyone...