title: Restart loop in a parallel array
body: <p>For my assignment, I cannot allow a user to enter a negative value for <code>rainfall</code> in the array. I'm suppose to restart the loop over again as if they didn't enter anything to start off with and have them try again. </p>
  
  <p>When I try it, I enter a negative value the first time, it restarts it for January, but after that I can enter more negatives and it just keeps asking me to keep entering for the rest of the months. I want it to keep restarting if I keep giving it negative numbers, until I start entering positive numbers. Then, that's when I display the total and average.</p>
  
  <pre><code>{
      const int SIZE = 12;
      string months[SIZE] = { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" };
  
      string Month[SIZE];
      double Rainfall[SIZE];
      int counter;
  
      double totalRainfall = 0.0;
  
      double averageRainfall = 0.0;
  
      for (counter = 0; counter &lt; SIZE; counter++)
      {
          cout &lt;&lt; "Enter the total rainfall for " &lt;&lt; months[counter] &lt;&lt; ": ";
          cin &gt;&gt; Rainfall[counter];
  
          if (Rainfall[counter] &lt; 0.0)
          {
              cout &lt;&lt; "Sorry, can't be a negative!" &lt;&lt; endl;
              do
              {
                  for (counter = 0; counter &lt; SIZE; counter++)
                  {
                      cout &lt;&lt; "Enter the total rainfall for " &lt;&lt; months[counter] &lt;&lt; ": ";
                      cin &gt;&gt; Rainfall[counter];
                  }
              } while (Rainfall[counter] &lt; 0.0);
          }
  
          averageRainfall = totalRainfall / SIZE;
          cout &lt;&lt; "Total rainfall for the whole year was: " &lt;&lt; totalRainfall &lt;&lt; setprecision(3) &lt;&lt; endl;
          cout &lt;&lt; "The average inches of rainfall was: " &lt;&lt; averageRainfall &lt;&lt; setprecision(3) &lt;&lt; endl;
  
          system("pause");
          return 0;
      }
  }
  </code></pre>