/********************* * Name: Geoff Towell * Purpose: functions to compute mean and standard deviation * Wrttten: August 5, 2019 * Modified: Sep 6, 2019 * Sep 12, 2019 *********************/ #include #include #include #include /** * Get a random number in specified range * param min the lower end of the range * param max the upper end of the range * return the random number */ int randrange(int min, int max) { return min + rand() / (RAND_MAX / (max - min + 1) + 1); } /** * Compute the mean of an array of integers * param n the size of the array * param data the array * return the mean of the array **/ float calculateMean(int n, int data[n]) { float sum = 0.0; int i; for(i=0; i