this is the best I could do and still something doesn't work right
the formula part for deviation
this is what I used as example, but we need to do N-1.
Looking for pointers!
the formula part for deviation
#include <iostream.h>
#include <math.h>
/*
Gives you mean and standard deviation of 4 numbers
*/
void Getdata ();
void Calculate ();
void MakeOutput ();
void main ();
void Calc ();
void MakeOut ();
float m,x1,x2,x3,x4,o;
void main()
{
Getdata();
Calculate();
MakeOutput();
Calc();
MakeOut();
}
void Getdata ()
{
cout<<" Enter First nubmer ";
cin>>x1;
cout<<" Enter Second number ";
cin>>x2;
cout<<" Enter Third nubmer ";
cin>>x3;
cout<<" Enter Forth number ";
cin>>x4;
Calculate ();
}
void Calculate ()
{
m=(x1+x2+x3+x4)*1/4; //this is how I got MEAN
MakeOutput ();
}
void MakeOutput ()
{
cout<<" Mean is ";
cout<<m; //m represents MEAN
Calc();
}
void Calc()
{
o = sqrt(pow(x1-m,2)+pow(x2-m,2)+pow(x3-m,2)+pow(x4-m,2)*1/3); //thats a formula for standard deviation, Square root of addition of every value minus mean squared and multiplied by 1/3.
MakeOut ();
}
void MakeOut ()
{
cout<<"Standard Deviation is ";
cout<<o;
}
this is what I used as example, but we need to do N-1.
Looking for pointers!