title: calculate average with user input
body: <p>I'm writing a program to calculate average with user input. </p>
  
  <pre><code>import java.util.Scanner;
  public class mean
  {   
      static Scanner input = new Scanner (System.in);
      public static void main (String[] args)
      {
      double i;
      double sum = 0;
      int count = 0;
      do
      {
          System.out.println("input");
          i = input.nextDouble();
          sum = sum + i;
          count++;
      }while (i != 0);
      System.out.println("sum is " + sum + " count is " + (count - 1));
      System.out.println("average is " + sum / (count - 1));
  }
  }
  </code></pre>
  
  <p>here if I input 0, it will calculate. but if there is 0s in the list. can somebody guide me a great while condition? </p>