title: Calculating Avg, Max, and Min using a .txt input file with both integers and strings mixed
body: <p>Please help. I've looked everywhere and am stumped on how to finish this program. I need to calculate the average, max, and min from a data input file. They need to look like this:</p>
  
  <pre><code>System.out.println("The average total score of the class is: " + total/27);
  System.out.println(maxName + "got the maximum score of: " + maxVal);
  System.out.println(minName + "got the maximum score of: " + minVal);
  </code></pre>
  
  <p>For the average I don't know why the while loop in my main isn't working. It calculates a value of zero. I also don't know how I can make it so the 27 isn't hard coded. For the max and min values, I have no clue about those. i don't even have a guess. A lot of things I've looked at for these use ways we haven't been taught (like a buffered something for instance, or using the Collections class which we haven't learned about that either. I just need a basic way of accomplishing these. I will include everything I have so far. Any help is appreciated. Thank you.</p>
  
  <p>Input File:</p>
  
  <pre><code>9
  Andy Borders
  200
  250
  400
  John Smith
  120
  220
  330
  Alvin Smith
  225
  300
  278
  Mike Borell
  250
  250
  500
  Jim Jones
  325
  325
  155
  Robert Fennel
  200
  150
  350
  Craig Fenner
  230
  220
  480
  Bill Johnson
  120
  150
  220
  Brent Garland
  220
  240
  350
  </code></pre>
  
  <p>Main:</p>
  
  <pre><code>import java.util.Scanner;
  import java.io.*;
  public class Project5 {
  
  public static void main(String[] args) {
      Scanner in = new Scanner(System.in);
      System.out.println("Enter the file name: ");
      String fileName = in.nextLine();
      try {
          File file = new File(fileName);
          Scanner inputFile = new Scanner(file);
          String SnumStudents = inputFile.nextLine();
          int numStudents = Integer.parseInt(SnumStudents);
          Student [] studentList = new Student[numStudents];
          for (int i = 0; i &lt; numStudents; i++)
          {
              String line = inputFile.nextLine();
              String score1 = inputFile.nextLine();
              String score2 = inputFile.nextLine();
              String score3 = inputFile.nextLine();
              studentList [i] = new Student(line, Integer.parseInt(score1), Integer.parseInt(score2), Integer.parseInt(score3));
          }
          System.out.println("Name\t\tScore1\tScore2\tScore3\tTotal");
          System.out.println("---------------------------------------------");
          for (int i=0; i&lt; studentList.length;i++){
              System.out.println(studentList[i].getName() + "\t" + studentList[i].getScore1() + "\t" + studentList[i].getScore2() + "\t" + studentList[i].getScore3() + "\t" + studentList[i].getTotal());
          }
          System.out.println("---------------------------------------------");
          System.out.println("The total number of students in this class is: " + studentList.length);
          int total = 0;
          while (inputFile.hasNextInt())
          {
              int value = inputFile.nextInt();
              total = total + value;
          }
          System.out.println("The average total score of the class is: " + total/27);
          System.out.println(maxName + "got the maximum score of: " + maxVal);
          System.out.println(minName + "got the maximum score of: " + minVal);
          inputFile.close();
      } catch (IOException e) {
          System.out.println("There was a problem reading from " + fileName);
      }
      finally {
      }
      in.close();
  }
  }
  </code></pre>
  
  <p>Student Class:</p>
  
  <pre><code>public class Student {
  private String name;
  private int score1;
  private int score2;
  private int score3;
  private int total;
  private double average;
  
  public Student(String n, int s1, int s2, int s3){
      name = n;
      score1 = s1;
      score2 = s2;
      score3 = s3;
      total = s1 + s2 + s3;
  }
  public String getName(){
      return name;
  }
  public int getScore1(){
      return score1;
  }
  public int getScore2(){
      return score2;
  }
  public int getScore3(){
      return score3;
  }
  public int getTotal(){
      return total;
  }
  public double computeAverage(){
      return average;
  }
  }
  </code></pre>