Write a program that computes the average and standard deviation of the text floating point numbers in a file. Use the following formulas for the average and the standard deviation of N values. The formulas compute the sum, the sum of squares, the average, the average square, the variance, and finally, the standard deviation.
sum = x1 + x2 + x3 + ... + xN-1 + xN
sumSQ = x12 + x22 + x32 + ... + xN-12 + xN2
avg = sum/N
avgSQ = avgSQ/N
var = avgSQ - avg2
sd = var(1/2)
The input file will contain any number text floating point numbers, similar to the following:
Numbers could be several, or none per line, and negative numbers are perfectly OK.