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
null
16,110 posts since May 2007
Reputation Points: 3,292
Solved Threads: 873
Skill Endorsements: 27
Seems like counting them might be useful?
Ezzaral
null
16,110 posts since May 2007
Reputation Points: 3,292
Solved Threads: 873
Skill Endorsements: 27
> 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
null
16,110 posts since May 2007
Reputation Points: 3,292
Solved Threads: 873
Skill Endorsements: 27
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 Sage
7,742 posts since Jun 2010
Reputation Points: 1,158
Solved Threads: 793
Skill Endorsements: 16
Question Answered as of 1 Year Ago by
Ezzaral,
hfx642
and
NormR1