Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

C++ Mean Grouped Code, Lab Reports of Computer Programming

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

2021/2022

Available from 07/17/2023

random-riri
random-riri 🇵🇭

2 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
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");
pf2

Partial preview of the text

Download C++ Mean Grouped Code and more Lab Reports Computer Programming in PDF only on Docsity!

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; }