Java Average Temperature
<p>Program works, but my average temperature is 1 decimal place off. Can't seem to figure out where I'm going wrong. Should one of my variables be a float? Any help is greatly appreciated!</p>

<p>Code:</p>

<pre><code>import java.util.Scanner;

   public class NumberAboveAverage {


      public static void main(String[] args) {

         Scanner input = new Scanner(System.in);
         final int TotalTemps = 10;
         double[] numbers = new double[TotalTemps];
         double sum = 0;
         double average = 0;
         double max = 0;
         for (int n = 0; n &lt; numbers.length; n++) {
            System.out.print("Enter a temperature: ");
            numbers[n] = input.nextInt();

            if (numbers[n] &gt; max) {
               max = numbers[n];
            }
            sum = numbers[n];
         }

         for (int i = 0; i &lt; numbers.length; i++) {
            sum = numbers[i];
         }

         average = sum / 10;
         System.out.println("Average temp = " + average);

         int count = 0;
         for (int i = 0; i &lt; numbers.length; i++) {
            if (numbers[i] &gt; average) {
               count++;
            }
         }
         System.out.println(count + " days were above average");
      }
   }
</code></pre>
