title: Having problems finding the error mentioned below that keeps program from running
body: <p>I'm having some problems running the program. Whenever, I try I get the java.util.InputMismatchException. 
  After searching about it, I noticed that it's when I try to get data but the next data isn't of that format ( in beginner terms ).
  I've tried multiple times to find what is causing the error, but I can't seem to find it :/</p>
  
  <p>And for those who find this to be sloppy, since arrays aren't used. I am not allowed to use them for this particular assignment.</p>
  
  <pre><code>import java.util.Scanner;
  import java.io.*;
  
  public class Huang_Grading
  {
      //Global variables
      private static int holdMinStudentID;
      private static int holdMinEnhStudentID;
      private static int holdMaxStudentID;
      private static int holdMaxEnhStudentID;
      private static int holdModeStudentID;
      private static int holdModeEnhStudentID;
  
      /**Main method to pull data from*/
      public static void main(String[] args) throws IOException
      {
          //Set up input file
          File inputFile = new File("gradeInput.txt");
  
          validateFile(inputFile);
          validateData(inputFile);
          printData();
      }
  
      /**Read in file location, give error message if file does not exist
         Also, save valid numbers to an output file*/
  
      /**Compute and return mean of all grades*/
      public static double mean(Boolean gradeType) throws IOException
      {
          Scanner fileInput = new Scanner("outputs.txt");
  
          //Declare variables
          double finalMean = 000.00;
          double earnedGrade;
          int enhancedGrade;
          double totalEnhancedGrade = 0;
          double totalEarnedGrade = 0;
          int studentID;
          int lines = 0;
  
          //Mean grade
          while(fileInput.hasNext())
          {
              studentID = fileInput.nextInt();
              enhancedGrade = fileInput.nextInt(); 
              earnedGrade = fileInput.nextDouble();
  
              if(gradeType == false)
              {
                  totalEarnedGrade = totalEarnedGrade + earnedGrade;
              }
              if(gradeType == true)
              {
                  totalEarnedGrade = totalEarnedGrade + earnedGrade;
                  totalEnhancedGrade = totalEnhancedGrade + enhancedGrade;
              }
              lines++;
              if(gradeType == false)
              {
                  finalMean = totalEarnedGrade/lines;
              }
              if(gradeType == true)
              {
                  finalMean = (totalEnhancedGrade + totalEarnedGrade)/lines;
              }
          }
          fileInput.close();
          return finalMean;
      }
  
      /**Compute and return minimum/maximum of all grades*/
  
      /**Print out results*/
      public static void printData() throws IOException
      {
          //Declare variables
          Boolean earned = false;
          Boolean enhanced = true;
  
          double meanEarnedGrade = mean(earned);
          double meanEnhancedGrade = mean(enhanced);
  
          System.out.printf("%25s%7.2f", "Mean Earned Grade:\n", meanEarnedGrade);
          System.out.printf("%25s%7.2f", "Mean Enhanced Grade:\n", meanEnhancedGrade);
      }
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/Oa4dt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Oa4dt.png" alt="error"></a></p>
  
  <p><a href="https://i.stack.imgur.com/Ho6En.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ho6En.png" alt="outputs.txt"></a></p>