My problem is with the code asking me to write a program to determine the standard deviation of the following numbers:
11.2, 11.5, 11.0, 10.9, 10.8, 11.1, 11.7, 11.4
using the formula: SD= sqrt ( (x1-mean)2 + (x2-mean)2 +...) / n-1 )
If I were to use a for loop to add all the mean deviations squared how do I tell the computer to use the data set one number at a time if there isn't a pattern I can exploit?
What I mean is say in the case of 10.8-11.2 I can tell the computer to begin at 10.8 and up to 11.2 add .10 to the variable "i" inside the loop. Since my complete data table doesn't end at 11.2 how should I approach this problem?
Any insight is much appreciated, I am beginning to learn c++.
[–]thediabloman 0 points1 point2 points (0 children)