title: How to find Standard deviation using arrays and a for loop?
body: <p>I'm trying to find the standard deviation of an array using a for loop.
  I have some code that might work but it gives me errors.
  I would appreciate some guidance and help! :-)</p>
  
  <p>Here is the code:</p>
  
  <pre><code>double StandardDeviation() {
      double Dog,Variance,StandardDeviationFormula;
  
      for (int k = 0; k &lt; TheArrayAssingment.length; k++) {
  
           Dog = Dog + (TheArrayAssingment[k] - Average()) 
                        * (TheArrayAssingment[k] - Average());
  
           Variance = Dog / (TheArrayAssingment.length - 1);
           StandardDeviationFormula = Math.sqrt(Variance);
  
      }
      return StandardDeviationFormula;
  }
  </code></pre>