title: Input Validation for Vectors C++
body: <p>I'm having a problem with the input validation of my do-while loop. My do-while loop only validates every other input</p>
  
  <p>Here's an example:</p>
  
  <pre><code>Please Enter Grade 1: 101 (It does not accept input) 
  
  Invalid Rage. Please Enter Range 0-100.
  Please Enter Grade 1: 101 (It accapts this input)
  
  Please Enter Grade 2: 101 (It does not accept input) 
  
  Invalid Rage. Please Enter Range 0-100.
  Please Enter Grade 2: 101 (It accapts this input)
  </code></pre>
  
  <p>Here's My Code:</p>
  
  <pre><code>for(vector&lt;double&gt;::size_type i = 0; i &lt; 15; i++)
    {
      do
      {
           cout &lt;&lt; "Please Enter Grade "&lt;&lt; i + 1 &lt;&lt;": " &lt;&lt; flush;
              cin &gt;&gt; gradesVector[i];
          }
          while(gradesVector[i] &lt; 0.0 &amp;&amp; gradesVector[i] &gt; 100.0);
          { 
              cout &lt;&lt; "Invalid Rage. Please Enter Range 0-100:\n";
                  cout &lt;&lt; "Please Enter Grade "&lt;&lt; i + 1 &lt;&lt;": " &lt;&lt; flush;
                      cin &gt;&gt; gradesVector[i];
           }   
  }
  </code></pre>