Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
As far as I can tell, there is no reason to ensure long division is done, since the actual average value isn't returned. You just need to know if your score is higher than the average and since all of the scores are integers, there is no case where the decimal would change whether you scored higher than the average or not.
Why don't you gust return yourPoints > avg?
First i was thinking, the average was not good, then i understand.
Thanks , nice code
I did the same, exept avg calculation. avg /= classPoints.length+1;
did I do wrong?
When calculating average values you need to make sure at least one of the divisors ist double/float because Integer/Long divisions result in integer/long values.
I would have thought the
long
would coerce theint
. . .Is the data type wrong?
you are lucky this works in this case because you calculated the average wrong. (Integer / Long division)