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

C++ coding. Any code that can help me start this is what I need. Please. 1. the

ID: 3684350 • Letter: C

Question

C++ coding. Any code that can help me start this is what I need. Please.

1. the number of grades n

2. the mean ?i=1 n gi n , where gi represents the grade of the i th of n grades,

3. the standard deviation ? ?i=1 n gi 2? 1 n(?i=1 n gi) 2 n?1 ,

4. the highest grade,

5. the number of students attaining the highest grade,

6. the lowest grade, 7. the number of students obtaining the lowest grade, 8. and the number of students with a grade less than 70.

Your cousin wants to you to write a computer program that will prompt him to enter the grades one at a time until he enters a negative number. He then wants you to print out the name of the item and its value, one per line. You may assume that all the grades are between 0 and 100.

Heres a pic.

Explanation / Answer

#include <iostream>
#include <math.h>
using namespace std;

void gradeBook()
{
    int flag=1,grades[100],sd[100],size=0,max=-1,min=999,noMax=0,noMin=0,noless70=0,total=0,sdtotal;
    float mean=0,stddev=0;
    cout<<"Enter grades";
    while(flag==1)
    {
        int tmp;
        cin>>tmp;
        if(tmp>0)
        {
        grades[size]=tmp;
        size++;
        }
        else
        flag=0;
    }
  
    cout<<"Grades are:"<<endl;
    for(int i=0;i<size;i++)
    {
        if(grades[i]>max)
        max=grades[i];
        if(grades[i]<min)
        min=grades[i];
        cout<<grades[i] <<" ";
        //count grades less than 70
        if(grades[i]<70)
        noless70++;
        total+=grades[i];
      
    }
     mean=total/size;
    for(int i=0;i<size;i++)
    {
        sd[i]=grades[i]-mean;
        sd[i]=sd[i]*sd[i];
        sdtotal+=sd[i];
        if(grades[i]==max)
        noMax++;
        if(grades[i]==min)
        noMin++;
    }
    stddev=sqrt(sdtotal/size);
    cout<< "No of grades are : "<<size<<endl;
    cout<<"Highest grade : "<<max<<endl;
    cout<<"No of highest grades : "<<noMax<<endl;
    cout<<"Lowest grades: "<<min<<endl;
    cout<<"No of lowest grades : "<<noMin<<endl;
    cout<<"Mean : "<<mean<<endl;
    cout<<"Standard deviation : "<<stddev<<endl;
}

int main()
{
gradeBook();
   return 0;
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote