title: Is there something in this code that defies syntax?
body: <p>The question gives 6 integers in a file, separated into lines:</p>
  
  <pre><code>5
  2
  3
  1
  3
  2
  </code></pre>
  
  <p>The 1st line describes the total number of days, and the others describe the number of hours per day. I am supposed to print the total number of days and the average number of hours. Here is my code below:</p>
  
  <pre><code>import java.io.File;
  import java.io.IOException;
  import java.util.Scanner;
  
  public class IFeelFine 
  {
      public static void main(String[] args) throws IOException
      {
          File file = new File("Tax.txt");
          Scanner in = new Scanner(file);
          double count = in.nextInt();
          double total = 0;
          for (double i = 0; i &lt; count; i++)
          {
              total += in.nextDouble();
          }
          double avg = total / count;
          System.out.println("Total vacation time missed: " + total + " hours");
          System.out.println("Average daily time missed: " + avg + " hours");
      }
  }
  </code></pre>
  
  <p>When I run this code, I get the following error message in Eclipse.</p>
  
  <pre><code>Exception in thread "main" java.util.NoSuchElementException
      at java.util.Scanner.throwFor(Unknown Source)
      at java.util.Scanner.next(Unknown Source)
      at java.util.Scanner.nextDouble(Unknown Source)
      at IFeelFine.main(IFeelFine.java:15)
  </code></pre>
  
  <p>What does that mean, and what do I have to fix to let the program run?
  Any help would be much appreciated.</p>