title: How can I find the highest, lowest, and average value of all test scores within my loop?
body: <p>Good afternoon, or whenever you are reading this. I am trying to figure out how I can find the minimum, highest, and average of test scores that a user enters. 
  I have a loop that keeps track of a sentinel value, which in my case is 999. So when the user enters 999 it quits the loop. I also have some level of data validation by checking if the user entered over 100 or under 0 as their input. However, my question is, how can I implement a way to get this code to find the values I need for my user inputs. My code is as follows:</p>
  
  <pre><code>import java.util.Scanner;
  public class TestScoreStatistics 
  {
  
      public static void main(String[] args) 
      {
          Scanner scn = new Scanner(System.in);
          int testScore;
          double totalScore = 0;
          final int QUIT = 999;
          final String PROMPT = "Enter a test score &gt;&gt;&gt; ";
          int lowScore;
          int highScore;
          String scoreString = "";
          int counter = 0;
  
          System.out.print(PROMPT);
          testScore = scn.nextInt();
  
          while (testScore != QUIT)
          {
  
              if (testScore &lt; 0 || testScore &gt; 100 )
              {
                  System.out.println("Incorect input field");
  
              }
              else
              {
                  scoreString += testScore + " ";
                  counter++;
              }
  
              System.out.print(PROMPT);
              testScore = scn.nextInt();
  
  
  
          }
          System.out.println(scoreString);
          System.out.println(counter + " valid test score(s)");
  
      }
  
  }
  </code></pre>