/*
 * Write an application that creates an int array of 
 * size 1000000, assigns a random integer between + and 
 * -10000 to each and computes the mean and 
 * standard deviation as decimal values.
 * Print those to the user.
 * 
 * Mean: 
 * (sum of all values) / (number of values)
 * 
 * Standard Deviation: 
 * The square root of 
 *    the average of 
 *      the squared differences of 
 *         each value from the mean.
 * 
 */

public class StandardDeviation{
  public static void main(String[] args){
    
    int[] values = new int[1000000];
    final int MIN_VALUE = -10000;
    final int MAX_VALUE = 10000;
    double valuesSum = 0.0, sqDiffSum = 0.0, mean, standardDev;
    
    // Set each element in values equal to a random
    // integer between MIN_VALUE and MAX_VALUE
    
    
    // Compute the sum of all elements in values,
    // such the sum gets stored in valuesSum
    
    
    
    // Compute the mean (average) of all values
    // and store in the variable mean

    
    // Compute the sum of the squared differences
    // of each value from the mean.  Conceptually,
    // this looks like:
    //    (first - mean)^2 + 
    //    (second - mean)^2 + 
    //    (third - mean)^2 + 
    //    ....... +
    //    (last - mean)^2 + 
    
    
    
    
    // Compute the standard deviation, which is the 
    // square root of the result of dividing the sum of 
    // squared differences by the total number of values

    
    
    System.out.println("Mean:               " + mean);
    System.out.println("Standard Deviation: " + standardDev);
    
  }
  
  private static int randomIntInRange(int low, int high) {
    
    int multiplier = high - (low - 1);
    return (int)(Math.random() * multiplier) + low;
    
  }
  
}
Your task, then, is to work in the area of the code I specify, adding in elements of code according to my comments. Note that, depending on any changes you make (such as adjusting the minimum and maximum values, the output could look different.

Program output example:

> run StandardDeviation
Mean:               -3.77569
Standard Deviation: 5779.955079273639
        
Question: How did the process of editing this program go for you? What were your main challenges and how did you overcome them? What did you learn that may be of use as you move along in this class?