LabH_Rosmawati
-
Upload
imfarosha-emma -
Category
Documents
-
view
214 -
download
0
Transcript of LabH_Rosmawati
-
8/11/2019 LabH_Rosmawati
1/2
/*Create by: Rosmawati binti aminuddin / Nur Rafiqah bt RidzuanStudents ID: CE110014 / CE110188Created Date: 21/05/2014Description of the Program: to write a C++ program that able to compute thestandard deviation of n numbers using the formula given.*/
#include #include using namespace std;
/*read n that represents number of input. Ensure that the n is not more than thesizeof array x. Then, get the input for array x */void Get_Input();//Compute the mean of an array of double values.double mean (double[] , int);//Compute the deviation of double valuesdouble deviation(double[] , int);
//display result of mean and deviationvoid display(double mean , double deviation);double mean2;
/*main function*/int main (){//begin main
Get_Input() ;system ("PAUSE");return 0 ;
}//end main
//=======================================
//Function definition of Get_Input//Task Description of Get_Input function//Task done by: Rosmawati binti aminuddin// Nur Rafiqah bt Ridzuan//========================================void Get_Input(){
int size=10;double x[10];mean2=0.0;cout
-
8/11/2019 LabH_Rosmawati
2/2
//========================================double mean (double x[], int data){
double sum=0;for ( int i = 0; i