How do I stop a certain part of a program using the user's input?
<p>I'm making a program that tallies grades. I want to know how to stop a certain part of a program based on the user's input. Below is the program I am working on. How do I stop the program if the user enters "done"? Also, I don't necessarily have to use "done" to exit the program. I was initially going to use -1, but I ran into a problem where I had to make a robust program where values &lt; 0 and > 100 are not accepted.</p>

<pre><code>   int grade;
   a=b=c=d=f=0;


   do
   {
      cout &lt;&lt; "Enter a grade or enter done to stop. ";


      if (grade &gt;= 90 &amp;&amp; grade &lt;= 100)
          {a++;}
      if (grade &gt;= 80 &amp;&amp; grade &lt; 90)
          {b++;}
      if (grade &gt;= 70 &amp;&amp; grade &lt; 80)
          {c++;}
      if (grade &gt;= 60 &amp;&amp; grade &lt; 70)
          {d++;}
      if (grade &gt;= 0 &amp;&amp; grade &lt; 60)
          {f++;}



   } while (grade != 'done');
</code></pre>
