1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
|
#include<iostream>
#include<cmath>
using namespace std;
int main()
{
const int size=56;
double R[size]={45.3, 67.8, 34.3, 51.2, 48.5, 61.3, 59.3, 65.1,
49.3, 42.4, 63.5, 69.8, 71.2, 39.8, 55.5, 53.2,
56.7, 48.8, 61.5, 51.2, 58.9, 63.1, 67.5, 62.4,
52.4, 50.2, 49.8, 56.8, 59.7, 60.4, 45.8, 43.8,
51.3, 54.8, 55.1, 52.3, 56.2, 59.7, 63.0, 46.7,
63.1, 58.2, 41.9, 59.2, 57.2, 67.3, 68.2, 38.9,
51.3, 63.8, 53.4, 58.9, 56.3, 58.9, 53.2, 56.8},
sum=0, mean, max=0, min=100, range, sum1, variance, std;
// Find average
for(int count=0; count<=size-1; count++)
{
sum=sum+R[count];
//cout<<sum<<" ";
//Find Maximum
if (R[count]> max)
{
max=R[count];
}
//Find Minimum
}
mean=sum/size;
range= ;
// Find the variance and standard devisation
for (int i=0; i<=size-1; i++)
{
sum1=sum1+( )*( );
}
variance=
std=sqrt(variance);
cout<<"The mean is "<<mean<<endl;
cout<<"The maximum is "<<max<<endl;
//cout<<"R[55]= "<<R[size-1]<<endl;
system("pause");
return 0;
}
|