title: Assigning a grade from an array
body: <p>I need to write a program that reads student scores, gets the best score, and then assigns grades based on the following scheme:</p>
  
  <p>1) Grade is A if score is >= best - 10 </p>
  
  <p>2) Grade is B if score is >= best - 20; </p>
  
  <p>3) Grade is C if score is >= best - 30; </p>
  
  <p>4) Grade is D if score is >= best - 40; </p>
  
  <p>5) Grade is F otherwise. </p>
  
  <p>The program prompts the user to enter the total number of students, then prompts the user to enter all of the scores, and concludes by displaying the grades.  My problem comes from pulling the grades from an array, this is what I have so far:</p>
  
  <pre><code> #include &lt;iostream&gt;
  #include &lt;string&gt;
  
  using namespace std;
  
  int studentGrade(int* gradeArray, int numberStudents)
  {
      int grade = 0;
      int score, best;
      for (int i = 0; i &lt; numberStudents; i++)
      {
          grade += gradeArray[i];
      }
  
      return (grade);
  }
  int main()
  {
      int numberStudents;
      cout &lt;&lt; "Enter the number of students: ";
      cin &gt;&gt; numberStudents;
  
      int* gradeArray = new int[numberStudents];
  
      for (int i = 0; i &lt; numberStudents; i++)
      {
          int score;
          cout &lt;&lt; "Enter the students Score: ";
          cin &gt;&gt; score;
  
          gradeArray[i] = score;
          cout &lt;&lt; gradeArray[i];
      }
  
  
  }
  </code></pre>