title: Trying to print to test a program to see it print a name and the contents of that name only if it is included in the file that it is reading
body: <p>This is a java program that works with a class file that I did not list here. My problem is: </p>
  
  <p>It prints the list from the file just fine, but  I need to now make the program ask the user for a last name. The program then has to check from the file to see </p>
  
  <ul>
  <li>if that last name was included and </li>
  <li>if it was to then print out the information profile of that last name such as the first name and the quiz average. Also </li>
  <li>if it is not a last name used in the program to then state no last name found </li>
  </ul>
  
  <p>Here is my code:</p>
  
  <pre><code>import java.util.Scanner;
  import java.io.*;
  import java.util.ArrayList;
  import java.io.File;//you need this to read the Employee file
  import java.io.FileNotFoundException;
  
  public class QuizAverages8 {
  
  
  public static void main(String[] args) throws FileNotFoundException {
      String sFindStu ="";
      ArrayList&lt;Student&gt; StudentList = new ArrayList&lt;Student&gt;();
      generateEmpList(StudentList);
      System.out.println("STUDENT ROSTER AND QUIZ AVERAGES");
      System.out.println("");
      System.out.println("Students in class: " + StudentList.size());
      System.out.println("");
  
  
      for (int nIndex = 0; nIndex &lt; StudentList.size(); nIndex++){
          printEmployee(StudentList.get(nIndex));
      }
  </code></pre>
  
  <p>// This is where I want to test to check the program if the last name is used</p>
  
  <pre><code>    System.out.print("Please enter the last name of a specific student: " );
      sFindStu = input.next();
      if (sFindStu.equals(StudentList.contains(args))){
         System.out.println(StudentList.get(nIndex));
      }   
      else{
          System.out.println("No name with " + sFindStu + "Found");
      }
  </code></pre>
  
  <p>// It ends here </p>
  
  <pre><code>}        
  public static void printEmployee(Student myStudent){
  
  System.out.println("Employee Name: " + myStudent.getFirstName() + " " + myStudent.getLastName().toUpperCase());
  System.out.println("Quiz average: " + myStudent.calculateQuizAverage());
  System.out.println(" ");
  }
  
  
  
  public static void generateEmpList(ArrayList&lt;Student&gt; list) throws 
  FileNotFoundException{
      String sFileName = "Students.txt";
      String sInputLine = " ";
      File fileToOpen = new File(sFileName);
      Scanner inputFile = new Scanner(fileToOpen);
      String[] saTokens = null;
      ArrayList&lt;Student&gt; empList = new ArrayList&lt;Student&gt;();
  
  
      while(inputFile.hasNext()){
          sInputLine = inputFile.nextLine();
          saTokens = sInputLine.split("-");
          Student emp = new Student();//create empty object
          emp.setFirstName(saTokens[0]);
          emp.setLastName(saTokens[1]);
          emp.setQuiz1(Integer.parseInt(saTokens[2]));
          emp.setQuiz2(Integer.parseInt(saTokens[3]));
          emp.setQuiz3(Integer.parseInt(saTokens[4]));
  
  
  
          list.add(emp);
      }
  
  }
  
  }
  </code></pre>