title: How to get average from given values
body: <p>How do I average?. I am suppose to find the average of the <code>GPA</code>, total of students, and the total of <code>GPA</code>.
  example:</p>
  
  <p><strong>input</strong>:
      4
      4
      4
      4</p>
  
  <p><strong>output:</strong>
  <em>Total Students</em>:4</p>
  
  <p><em>Total GPA</em>:16</p>
  
  <p><em>Average GPA:</em> 4</p>
  
  <pre><code>import java.util.Scanner;
  
  public class practice {
      public static void main(String[] args) {
          Scanner keyboard = new Scanner(System.in);
          int count = 0;
          double GPA = 0, total = 0, average;
  
          System.out.println("Enter GPA");
  
          while (GPA &gt;= 0) {
              GPA = keyboard.nextDouble();
              total = total + GPA;
              count++;
          }
  
          average = total / count;
  
          System.out.println("Total students: " + count);
          System.out.println("Total GPA " + total);
          System.out.println("Average GPA " + average);
      }
  }
  </code></pre>