

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
This is a C++ Code for Mean Grouped. Dataset is user input. Code Explanation: size will hold how many datasets to be inserted, data will hold the inputted data, freq will hold the frequency of each data, XiFi will hold the results for each data multiplied by each frequency. Then the data will compute the mean of the dataset. It will display the ff: Summation of total observations (variable : sXiFi) Summation of total frequencies (variable : sfreq) Mean Value (variable : mean)
Typology: Lab Reports
1 / 2
This page cannot be seen from the preview
Don't miss anything!
C++ Code for Mean Grouped: w/ frequency dataset. CODE int main() { int size, data[100], freq[100], XiFi[100]; double sfreq, sXiFi, mean; cout<<"How many datasets?"; cin>>size; cout<<endl; for (int i=0; i<size; i++){ cout<<"Enter number:"; cin>>data[i]; cout<<"Frequency: "; cin>>freq[i]; XiFi[i]=data[i]*freq[i]; sfreq=sfreq+freq[i]; sXiFi=sXiFi+XiFi[i]; mean=sXiFi/sfreq; } system("cls");
cout<<"Statistical Mean Grouped"<<endl; cout<<"Xi\t\t\tFi\t\t\tXiFi"<<endl; for (int i=0; i<size; i++){ cout<<data[i]<<"\t\t\t"<<freq[i]<<"\t\t\t"<<XiFi[i]<<endl; } cout<<endl; cout<<"Summation of total observations: "<<sXiFi<<endl; cout<<"Summation of total frequencies: "<<sfreq<<endl; cout<<endl; cout<<"Mean Value:"<<mean; }