hi, i m working on a stardard deviation c++ code
my assignment is to find the std. dev. of " double x[] = {2,4,4,4,5,5,7,-9}; "
and i dont know why my instructor require us to put "double stddev(double arg[], int length)" this as the variable of the std dev
and here is what i have so far...
Line 8: this is a function forward declaration
I believe that you are supposed to do something like:
1 2 3 4 5 6 7 8 9 10 11 12 13
double stddev(double arg[], int length);
int main()
{
double x[] = {2,4,4,4,5,5,7,-9}; //Length of 8
double dev = stddev(x, 8);
std::cout << "S.D.:" << dev << std::endl;
}
double stddev(double arg[], int length)
{
/*Calculate standard deviation here and return the result*/
}