title: Golf score program?
body: <p>So I'm trying to make a program where it averages out your golf scores. I edited a standard averaging calculator to make it work:</p>
  
  <pre><code>import java.util.Scanner;
  public class Test {
  public static void main(String args[]){
      Scanner input = new Scanner(System.in);
      int total = 0;
      int score;
      int average;
      int counter = 0;
  
      while (counter &gt;= 0){
      score = input.nextInt();
      total = total + score;
      counter++;
      }
      average= total/10;
      System.out.println("Your average score is "+ average);
  }
  }
  </code></pre>
  
  <p>But when I enter scores, I can keep entering infinite scores and it never averages them. It just keeps expecting another score. I know it has something to do with this line:</p>
  
  <pre><code>while (counter &gt;= 0){
  </code></pre>
  
  <p>but I'm not sure what to do so it works right.</p>