Please take a look at this topic :
Can I calculate the average of these numbers?
How can I write a program for this?
In the right answer, he just wrote the equation without the java program and he used for example newValue without intialise the newValue.
Here is the equation:
int currentScore = (currentScore * currentCount + newValue) / currentCount;
Please find broken steps as below:
If you are looking for sample program, it can be something like this: