title: JAVA Problems with if statement? Cannot display end result correctly.
body: <p>I am trying to print "tuition will increase" when there are at least three students that averaged 70%+ and print "tuition will not increase" if there are less than 3 students that averaged 70%+. My problem is, even when the average is not above 70%, the program will print "tuition will increase." I'm not sure what I've done wrong. I've tried changing the if statement and I feel like I'm missing something very simple. </p>
  
  <pre><code> public static void main(String[] args)
      {
          // Create Scanner
          Scanner input = new Scanner(System.in); 
  
          // Create array to store 5 students and 3 classes per student
          int[][] grades = new int[5][3]; 
  
          // Create array to store students first and last name
          String[] names = new String[5]; 
  
          // Create array to store average scores
          double[] avgScores = new double[5]; 
  
          // Prompt user to input name
          for (int i = 0; i &lt; names.length; i++)
          {
              System.out.print("Enter the student's first and last name: ");
              names[i] = input.nextLine(); 
          }
  
  
          double average = 0; 
          int score; // student's grade
          int finalGrade = 0; // collective grades
          int goodStudents = 0; // students that received average of 70+
  
          // Prompt user to input grades using nested for loop
          for (int i = 0; i &lt;= 4; i++) // from student 1 to student 5
          {
              for (int k = 0; k &lt;= 2; k++) // from class 1 to class 3 
              {
                  System.out.print("Enter the grade for class " + (k + 1) + " " + "for student "
                          + (i + 1) + " : "); 
                  grades[i][k] = input.nextInt();
  
                  score = grades[i][k]; 
                  finalGrade = finalGrade + score; 
              }
  
              // Calculate the average score for the 3 classes
              avgScores[i] = finalGrade / 3; 
  
              finalGrade = 0; // reset 
          }   
              for (int j = 0; j &lt;= 4; j++)
              {
                  if (avgScores[j] &lt; 70)
                  {
                      goodStudents++; 
                  }
  
          }
  
          // count the number of students that have 70+ average
  
              if (goodStudents &gt;= 3)
              {
                  System.out.println("Tuition will be increased by 10% next semester.");
              } else if (goodStudents &lt; 3)
              {
                  System.out.println("Tuition will not be increased.");
              }   
  
      }
  </code></pre>