title: Why doesn't my "While Loop" print the computation of finding the average "score"?
body: <p>I am writing a program that reads a sequence of positive integers input by the user. User will only enter one integer at a time.Then it will compute the average of those integers. The program will end when user enters 0. (0 is not counted in the average).The program will print out the average once the program ends.</p>
  
  <p>Question: My code stops working when I gets to the while loop hence it doesn't compute the input by user, hence prints out nothing. Why doesn't my while loop compute the average from the user's inputs? <em>Appreciate your guidance :)</em></p>
  
  <pre><code>import java.util.Scanner;
  
  public class AverageOfIntegers {
  
      public static void main(String[] args) {
  
          int integer;
          double sum;
          sum = 0;
          double average;
          Scanner input = new Scanner(System.in);
          int count; count = 0; 
          average = 0;
  
  
          System.out.println("Please enter an integer: ");
  
          integer = input.nextInt();
  
  
          while (integer != 0) {
          count = count + 1;  
  
              sum = sum + integer; 
  
              average = sum / count;
  
          }
  
          System.out.println("Average = " + average);
  
      }
  
  }
  </code></pre>