Std Deviation and mean help with program

How do I put std dev and mean funtions in this problem?
I need to put this into my program:

double mean(double x[], int n);
double stddev(double x[], int n);

Can you help me?



1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 #include <cstdlib>
#include <iostream>
#include <fstream>
#include <cmath>

using namespace std;

int main(int argc, char *argv[])

{
int N;
cout << "Please enter the number of numbers: ";
cin >> N;
float a[N];


double b[3][2];
double c[5];


ifstream input_file;

input_file.open("randomData.txt"); // open the input file

//******** Input ***********
for (int i=0;i<N;i++)
input_file >> a[i];


int l,k;
for (k=0;k<=2;k++)
{ for (l=0;l<=1;l++)
{
input_file >> b[k][l];
cout << b[k][l] << endl;
};
};

for (int i=0;i<4;i++)
input_file >> c[i] ;
c[4] = 12.7;
c[5] = 7.0;



cout << "Vector A = " << a[0] << " " << a[1] << " " << a[2] << endl;


for (int i=0;i<=2;i++)
{ for (int j=0;j<=1;j++)
{ cout << b[i][j] << " ";}
; cout << endl;
};

cout << c[0] << " " << c[1] << " " << c[2] << endl;
cout << c[4] << " " << c[5] << endl;


input_file.close();

system("PAUSE");

return EXIT_SUCCESS;

}
Topic archived. No new replies allowed.