title: I'm writing a very simple letter grading system, are if statements the most efficient?
body: <p>Code example:</p>
  
  <pre><code>question:
  cout &lt;&lt; "Enter the grade % you scored on the test: ";
  cin &gt;&gt; userScore;
  
  if (userScore == 100) {
      cout &lt;&lt; "You got a perfect score!" &lt;&lt; endl;
  }   
  else if (userScore &gt;= 90 &amp;&amp; userScore &lt; 100) {
      cout &lt;&lt; "You scored an A." &lt;&lt; endl;
  }
  else if (userScore &gt;= 80 &amp;&amp; userScore &lt; 89) {
      cout &lt;&lt; "You scored a B." &lt;&lt; endl;
  }
  //... and so on...
  else if (userScore &gt;= 0 &amp;&amp; userScore &lt; 59) {
      cout &lt;&lt; "You scored an F." &lt;&lt; endl;
  }
  goto question;
  </code></pre>
  
  <p>This code has a total of 6 if statements, and it looks very.. cookie-cutter-ish.. I guess? Is there a more efficient/optimal way to write this? </p>
  
  <p>I looked up some example beginner projects for C++ and found <a href="http://www.cplusplus.com/forum/articles/12974/" rel="nofollow noreferrer">this grading one</a>, and it said knowledge of switch statements would be useful. I looked into that and my understanding is that, in this case, switch statements would effectively work the same way as if statements.</p>