Q:

How to write a java program for this equation

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;

A:

Please find broken steps as below:
   private float calculateNewScore(){
        float currentScore = 6.1123
        int currentCount = 12;
        float newValue = 4.5;
        int newCount = currentCount+1;

        float newScore = (currentScore * currentCount + newValue) / newCount ;

    }

If you are looking for sample program, it can be something like this:
 public class CalculateScore {

  public static void main(String[] args) {
    float currentScore = 6.1123; //you can initialize with any desired value
    int currentCount = 12;//you can initialize with any desired value

    float newValue = 0;
    Scanner scanner = new Scanner( System.in );     

    do{
        System.out.println("Enter your new value. Enter 0 or negative to exit.");
        newValue = scanner.nextFloat();
        if(newValue>0){
            currentScore = (currentScore*currentCount+newValue)/(++currentCount);
            System.out.println("Your new score is "+currentScore);
        }else{
            System.out.println("Program is exiting");
        }

    }while(newValue >0);
   }
  }

