Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please in C languge start with Include<stdio.h> program that reads grades from t

ID: 3908119 • Letter: P

Question

Please in C languge start with Include<stdio.h> program that reads grades from the user continuously until a grade greater than 100 ss than 0 is entered. Also, the program should perform the following tasks: 1. Store all grades in 1D array named gradest 1 2. Compute and display the average value of all grades. . Store all passing grades i.e., [60, 100] in an another 1D array named passGradest then compute and display the standard deviation of passing grades. Where, the standard deviation can be computed as: i 1 here N is the number of the statistical sample and ? is the mean (average) of the atistical sample re all failing grades i.e., [O, 60) in an another 1D array named failGradest 1, then ay all failing grades, and display how many failing grades it has. ut may look like 1: 68

Explanation / Answer

#include <stdio.h>
#include <math.h>

float calculateSD(float data[],int len)
{
float sum = 0.0, mean, standardDeviation = 0.0;

int i;

for(i=0; i<len; ++i)
{
sum += data[i];
}

mean = sum/len;

for(i=0; i<len; ++i)
standardDeviation += pow(data[i] - mean, 2);

return sqrt(standardDeviation/len);
}

int main()
{
int grade[100];
int len=0;
int temp;
int sum_grade=0;
for(int i=0;i<100;i++){
scanf("%d",&temp);
if(temp>100 || temp<0)
break;
grade[len]=temp;
sum_grade+=temp;
len++;
}
  
double avg=sum_grade/len;
printf("the average = %f ",avg);
  
float pass_grade[0];
int pass_len=0;
for(int i=0;i<=len;i++){
if(grade[i]>60 && grade[i]){
pass_grade[pass_len]=(float)grade[i];
pass_len++;
}
}
  
float std=calculateSD(pass_grade,pass_len+1);
  
printf(" THe standard deviation = %f",std);
  
  
  
return 0;
}