Question: I would like to complete the function estimate in c++. The complete function calculates the mean and standard deviation on each of the 4 subjects.

I would like to complete the function "estimate" in c++. The complete function calculates the mean and standard deviation on each of the 4 subjects.

Book1.txt

x 70 85 78 82 F 65 78 99 84 85 99 80 85 df{ 95 80 99 80 w 83 93 78 82 L 95 90 99 84 H 93 93 80 85 84 82 99 80 95 92 99 80 iR 93 83 99 80 R 93 83 78 82 82 85 99 84 84 90 80 85 y 85 70 99 80 LM 90 65 95 92 90 85 93 83 \ 94 95 93 83 90 83 82 85 aR 88 95 84 90 i 90 93 99 80 v 88 84 78 82 Bs 92 95 99 84 f 84 93 80 85 @ 85 93 95 92 K 78 82 93 83 99 84 93 83 cN 80 85 82 85 L 93 90 84 90 PHw 90 90 78 82 B 93 94 99 84 hp 82 90 80 85 Gg 92 88 95 92 W 83 90 93 83 }P 83 88 93 83 aa 85 92 82 85 90 84 84 90

Program:

#include #define MAX 100

using namespace std;

struct DATA {

char Name[10]; int Score[4]; int Total; float Average; int ID; int Rank;

};

DATA Data[MAX];

void Print_Out(DATA *lp, int N) { for (int i = 0; i Name, lp->Score[0], lp->Score[1], lp->Score[2], lp->Score[3], lp->Total, lp->ID, lp->Rank); lp++; } }

void Sorting(DATA* lp, int N) { DATA Tmp, * pi, * pj; int i, j, L = sizeof(DATA); for (i=0; iTotal Total) { memcpy(&Tmp, pi, L); memcpy(pi, pj, L); memcpy(pj, &Tmp, L); } pi->Rank = i + 1; } lp[N - 1].Rank = N; }

void Estimate(DATA* lp, int No, float* Mean, float* Std_Dev) {

}

int main() { errno_t err; FILE* In; int No = 0; DATA* lp; if ((err = fopen_s(&In, "Book1.txt", "rb")) != 0) { cout Score + 0, lp->Score + 1, lp->Score + 2, lp->Score + 3); lp->Total = *lp->Score + *(lp->Score + 1) + *(lp->Score + 2) + *(lp->Score + 3); lp->Average = (float)lp->Total / 4; lp->ID = No + 1; No++; } Sorting(Data, No);

Print_Out(Data, No); float Mean[4], Std_Dev[4]; Estimate(Data, No, Mean, Std_Dev);

for (int i = 0; i

}

for now, the program is not complete and runs as follows

I would like to complete the function "estimate" in c++. The complete

the mean and standard deviation of the 4 subjects needed to be calculated

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!