title: Would These Be Considered Magic Numbers?
body: <p>I've just completed writing a program for a programming class, and I want to avoid use of magic numbers, so here's my question:</p>
  
  <p>In the function below, would my array indexers be considered magic numbers?</p>
  
  <p>Code:</p>
  
  <pre><code>string CalcGrade(int s1, int s2, int s3, double median)
  {
  const int SIZE = 23;
  const int LETTER_GRADE_BARRIERS[SIZE] = { 400, 381, 380, 361, 360, 341, 340, 321, 320, 301, 300, 281, 280, 261, 260, 241, 240, 221, 220, 201, 200, 181, 180 }; 
  double finalGrade;
  string letterGrade;
  
  finalGrade = s1 + s2 + s3 + median;
  
  if (finalGrade &gt;= LETTER_GRADE_BARRIERS[1] &amp;&amp; finalGrade &lt;= LETTER_GRADE_BARRIERS[0])
  {
      letterGrade = "A";
  }
  else if (finalGrade &gt;= LETTER_GRADE_BARRIERS[3] &amp;&amp; finalGrade &lt;= LETTER_GRADE_BARRIERS[2])
  {
      letterGrade = "A-";
  }
  else if (finalGrade &gt;= LETTER_GRADE_BARRIERS[5] &amp;&amp; finalGrade &lt;= LETTER_GRADE_BARRIERS[4])
  {
      letterGrade = "B+";
  }
  else if (finalGrade &gt;= LETTER_GRADE_BARRIERS[7] &amp;&amp; finalGrade &lt;= LETTER_GRADE_BARRIERS[6])
  {
      letterGrade = "B";
  }
  else if (finalGrade &gt;= LETTER_GRADE_BARRIERS[9] &amp;&amp; finalGrade &lt;= LETTER_GRADE_BARRIERS[8])
  {
      letterGrade = "B-";
  }
  else if (finalGrade &gt;= LETTER_GRADE_BARRIERS[11] &amp;&amp; finalGrade &lt;= LETTER_GRADE_BARRIERS[10])
  {
      letterGrade = "C+";
  }
  else if (finalGrade &gt;= LETTER_GRADE_BARRIERS[13] &amp;&amp; finalGrade &lt;= LETTER_GRADE_BARRIERS[12])
  {
      letterGrade = "C";
  }
  else if (finalGrade &gt;= LETTER_GRADE_BARRIERS[15] &amp;&amp; finalGrade &lt;= LETTER_GRADE_BARRIERS[14])
  {
      letterGrade = "C-";
  }
  else if (finalGrade &gt;= LETTER_GRADE_BARRIERS[17] &amp;&amp; finalGrade &lt;= LETTER_GRADE_BARRIERS[16])
  {
      letterGrade = "D+";
  }
  else if (finalGrade &gt;= LETTER_GRADE_BARRIERS[19] &amp;&amp; finalGrade &lt;= LETTER_GRADE_BARRIERS[18])
  {
      letterGrade = "D";
  }
  else if (finalGrade &gt;= LETTER_GRADE_BARRIERS[21] &amp;&amp; finalGrade &lt;= LETTER_GRADE_BARRIERS[20])
  {
      letterGrade = "D-";
  }
  else if (finalGrade &lt;= LETTER_GRADE_BARRIERS[22])
  {
      letterGrade = "Fail";
  }
  
  return letterGrade;
  }
  </code></pre>
  
  <p>Thanks!</p>