Can I calculate the average of these numbers?
I was wondering if it's possible to calculate the average of some numbers if I have this: int currentCount = 12; float currentScore = 6.1123 (this is a range of 1 <-> 10). Now, if I receive another score (let's say 4.5), can I recalculate the average so it would be something like: int currentCount now equals 13 float currentScore now equals ????? or is this impossible and I still need to remember the list of scores? The following formulas allow you to track averages just from stored average and count, as you requested. currentScore = (currentScore * currentCount + newValue) / (currentCount + 1