title: Recording individual average and cummulative average and highest average score
body: <p>I am trying to create a program that calculates the average scores for bowlers, the team average score, and the highest average score on the team.</p>
  
  <p>Problems:</p>
  
  <ol>
  <li>I am unable to figure out how to display all the individual player averages at the end without displaying everytime the loop iterates.</li>
  <li>how do I set up the code so that I can calculate the cummulative average and highest average score?</li>
  </ol>
  
  <p>Below is the code I wrote so far</p>
  
  <pre><code>import java.util.*;
  
  public class bowlerama2 
  {
      public static void main(String args[])
      {
          Scanner keyboard=new Scanner(System.in);
          int players;// for number of players on the team
          int games=0;// for number of games played
          int totalGames=0;
          System.out.println("Enter the number of players on the bowling team.");
          System.out.println("You must enter a number greater than or equal to three");
          players=keyboard.nextInt();
  
          //input validation
          while (players&lt;3)
          {
              System.out.println("Invalid entry. You must enter a number greater than or equal to three for the number of players on the team.");
              System.out.println("Enter the number of players on the bowling team:");
              players=keyboard.nextInt();
          }
  
  
          for(int number=1;number&lt;=players;number++)
          {   
              System.out.println("Enter the number of games bowled by player " + number + ":");
              System.out.println("You must enter a number greater than or equal to two.");
              games=keyboard.nextInt();
              while (games&lt;2)
              {
                  System.out.println("Invalid entry.You must enter a number greater than or equal to two for the number of games played");
                  System.out.println("Enter the number of games bowled by player " +number+ ":");
                  games=keyboard.nextInt();
              }
              totalGames+=games;
  
              receive (number, games, totalGames);
  
          }
  
      }
      public static void receive (int number, int games, int totalGames)
      {
          Scanner keyboard= new Scanner(System.in);
          int total=0;//accumulator for individual scores
          int score=0;
          int average=0;
  
  
          for (int amount=1;amount&lt;=games;amount++)
          {
  
              System.out.println("Enter the score for player " +number+ " in game " + amount + ":");
              score=keyboard.nextInt();
  
              //input validation
              while(score&lt;0 || score&gt;300)
              {
                  System.out.println("Invalid entry. Score must be greater than or equal to zero and less than or equal to three hundred");
                  System.out.println("Enter the score for player " + number+ " in game " +amount+ ":");
                  score=keyboard.nextInt();
              }
  
              total+=score;
              average=total/amount;
  
              System.out.println("The average score for player " +number+ " is:" + average);
          }
  
  
  
  
      }
  
  }
  </code></pre>