Курсовая работа: Система обработки научных данных
break;
}
case 3:
{ cout<<"Enter the total no of data";
cin>>nn;
char s[20],s4[20];
cout<<" X denotes ";
cin>>s;
cout<<" Frequency denotes ";
cin>>s4;
for(int i=0;i<nn;i++)
{
cout<<"X"<<i+1<<" =";
cin>>a[i];
cout<<"Freq"<<i+1<<" =";
cin>>b[i];
s3 = s3+b[i];
}
cout<<"The sum of f = "<<s3<<endl;
for(i=0;i<nn;i++)
{
s1 =s1+ (a[i]*b[i]);
}
cout<<"The sum of f*x = "<<s1<<endl;
mean = s1/s3;
for(i=0;i<nn;i++)
{
c[i] = pow((a[i]-mean),2);
s2 = s2 +(c[i]*b[i]);