title: Average of an array (struct)
body: <p>I've been going at this and can't seem to find the right way to do it. I only left the code that works because the rest is just embarrassing...</p>
  
  <p><em>Create a program using 2 arrays that holds a class set of data for 10 students:
  The first array holds the first and last name (in different cells) of the students
  The second array holds the grades (5 total) for each of the students
  Create appropriate functions to load and display the array including the average 
  and letter grade of the student. Drop the lowest grade from the student's average.</em></p>
  
  <p>I'm not asking for someone to do it for me, I just would like some help.</p>
  
  <pre><code>#include &lt;cstdlib&gt;
  #include &lt;iostream&gt;
  
  using namespace std;
  
  const int CLASSIZE = 1;
  
  struct student
  {
      string firstName;
      string lastName;
  
      void printTheInfo()
      {
          cout &lt;&lt; "Name: " &lt;&lt; firstName &lt;&lt; " " &lt;&lt; lastName;
      }
      void loadMe()
      {
          cout &lt;&lt; "First Name: ";
          cin &gt;&gt; firstName;
          cout &lt;&lt; "Last Name: ";
          cin &gt;&gt; lastName;
      }
  };
  struct grades
  {
      int grade1;
      int grade2;
      int grade3;
      int grade4;
      int grade5;
  
      void printTheGrades()
      {
          cout &lt;&lt; " Grades: " &lt;&lt; grade1 &lt;&lt; " " &lt;&lt; grade2 &lt;&lt; " " &lt;&lt; grade3
               &lt;&lt; " " &lt;&lt; grade4 &lt;&lt; " " &lt;&lt; grade5 &lt;&lt; endl;
      }
      void loadGrades()
      {
          cout &lt;&lt; "Grade 1: ";
          cin &gt;&gt; grade1;
          cout &lt;&lt; "Grade 2: ";
          cin &gt;&gt; grade2;
          cout &lt;&lt; "Grade 3: ";
          cin &gt;&gt; grade3;
          cout &lt;&lt; "Grade 4: ";
          cin &gt;&gt; grade4;
          cout &lt;&lt; "Grade 5: ";
          cin &gt;&gt; grade5;
      }
  };
  
  void printAllStudents(student [], grades [], int);
  void loadAllStudents(student [], grades [], int);
  
  int main(int argc, char *argv[])
  {    
      student theStudent[CLASSIZE];
      grades theGrade[CLASSIZE];
  
      loadAllStudents(theStudent, theGrade, CLASSIZE);
      printAllStudents(theStudent, theGrade, CLASSIZE);
  
      system("PAUSE");
      return EXIT_SUCCESS;
  }
  
  void loadAllStudents(student theStudents[], grades theGrades[], int s) 
  {
      for(int i = 0; i &lt; s; i++)
      {
          theStudents[i].loadMe();
          theGrades[i].loadGrades();
      }
  }
  void printAllStudents(student theStudents[], grades theGrades[], int s) 
  {
      for(int i = 0; i &lt; s; i++)
      {
          theStudents[i].printTheInfo(); 
          theGrades[i].printTheGrades();
      }
  }
  </code></pre>