title: How to calculate Highschool average for admission?
body: <p>I want to calculate the high school average for admission. The user will enter lets say 75 as his/her high school average. Then the system will <strong>output Smith, average=87, York-admitted, McGill-rejected, UofT- rejected.</strong></p>
  <p>The user will input average mark into a textfield and choose at least 3 universities from a JList object. When he/she hits submit, it allows the user to enter the input data coming from textfields and JList object into an array with maximum 100 Student objects.</p>
  <p>Class Student encapsulates the student information relevant for universities admission: student name, high school average and 3 universities chosen</p>
  <p>I'm not quiet sure how to produce this part of the output <strong>York-admitted, McGill-rejected, UofT- rejected.</strong>**</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>University</th>
  <th>HighSchool average for admission</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>Toronto</td>
  <td>90</td>
  </tr>
  <tr>
  <td>York</td>
  <td>84</td>
  </tr>
  <tr>
  <td>Brock</td>
  <td>75</td>
  </tr>
  <tr>
  <td>McGill</td>
  <td>76</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>I thought about creating an array of marks as such:</p>
  <pre><code>private int grades[] = {90,84,75,76,88,90,78,82,80};
  
  for (int grd: grades)
     if(mark &gt; grade.length) // But I'm not sure if I'm on the right track. 
  </code></pre>
  <p>Part of my current code is below.</p>
  <pre><code>//My student class
      class Student
  {
     private String fName;
     private int mark;
     private String uni1, uni2, uni3;
        
     public Student(String n, int m, String u1, String u2, String u3)
     {
        fName = n;
        mark = m;
        uni1 = u1;
        uni2 = u2;
        uni3 = u3;
        
     }
     
     public String getName()
     {
        return fName;
     }
     
     public int getMark()
     {
        return mark;
     }
     
     public String getUni()
     {
        // should I create my cases here to compare the marks?
        return 0;
     }
     public String toString()
     {
        return fName + &quot;,&quot; + &quot;average=&quot; + mark + getUni() + &quot;\n&quot;;
     }
  
  }
    
       // handle button events
       public void actionPerformed(ActionEvent event) 
          {
               String s1 =&quot;&quot;;
                String s2 = &quot;&quot;;
                String uList;
                
                
                
                if (event.getSource() == b1) // the submit button
                {
                   s1=t1.getText();
                   s2=t2.getText();   // retrieve the average mark 
                   int mark = Integer.parseInt(s2); 
                   uList = universityList.getSelectedValue().toString();
                   st[count++] = new Student(getName(), mark);
                   t1.setText(&quot;&quot;);
                   t2.setText(&quot;&quot;);
                   l4.setText(&quot;Student&quot; + count + &quot;out of 100&quot;);
                }
  </code></pre>
  <p>Thanks for your help in advance.</p>