title: For Loop C#-- Adding
body: <p>How to find a loop that will successfully add 5 numbers. Here is the homework question.</p>
  
  <ol>
  <li>Add a loop that will take a number input by the user and add it to a running total (the ReadLine() method will get a string from the user).  </li>
  </ol>
  
  <p>You’ll notice in the above code there are two variables declared.<br>
  One is total of the double data type which will have the total of the 5 entered numbers.<br>
  The other is a temp string variable to take the user input, convert to double, and then add the converted value to the total. </p>
  
  <p>Using what you have learned in case 2 about taking input and converting to an int32, take the input and convert ToDouble() instead of int32.<br>
  total = total + Convert.ToDouble(temp);</p>
  
  <pre><code>    case "3":
      double total = 0;
      string temp = "0";
      Console.WriteLine("Enter 5 numbers here for addition \n");
      for (total = 0; total &lt;= 6; total++);
      {
          Console.WriteLine(total + "" + temp);
          total = total + Convert.ToDouble(temp);
      }
      break;  
  </code></pre>
  
  <p>When I tried entering this in, the debugging program exited out and gave me a set number.
  It keeps saying that string will not convert to integer when I tried entering string as an expressions instead. </p>
  
  <p>Here is the result I am trying to get.</p>
  
  <p>1
  2
  3
  4
  5
  Total:15 This is the answer I am trying to get.</p>