You are dividing by the length of the grades array, but not all of those elements have a value. You need to divide by the actual number of entries the user has added.
Ezzaral
Posting Genius
15,986 posts since May 2007
Reputation Points: 3,250
Solved Threads: 847
Seems like counting them might be useful?
Ezzaral
Posting Genius
15,986 posts since May 2007
Reputation Points: 3,250
Solved Threads: 847
> im clueless on how to get it to see the amount of grades that were entered
Seems like a fairly simple task for a variable.
Edit: Ah, well so much for letting you see the solution for yourself, since hfx642 has decided to just hand you a fix.
Ezzaral
Posting Genius
15,986 posts since May 2007
Reputation Points: 3,250
Solved Threads: 847
Define an int as a counter, then add one to a counter every time a new number is entered. Look at about line 16 to do this
NormR1
Posting Expert
6,677 posts since Jun 2010
Reputation Points: 1,138
Solved Threads: 656