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

Ok, I\'ve gotten some interesting answers so far to my question I\'ve asked 3 ti

ID: 665030 • Letter: O

Question

Ok, I've gotten some interesting answers so far to my question I've asked 3 times. Everyone however, has calculated the 2nd final average INCORRECTLY. Please read entire question.

The formula should be

0.3*grade1 + 0.2 *grade2 + 0.2 * grade3 + 0.3 * grade4

PLEASE, please, please use the above formula for average 2. For example, the avg 2 for the 3rd line should be exactly 83.7 with this calculation.

Also, please do not use .h files. I am using DEV C++ to compile this and they don't work with it.


Below = original question

Write a program that a C++ program that can be used to determine grades at the end of the semester.

For each student, who is identified by an integer number between 1 and 60, four examination grades must be kept. Additionally, two final grade averages must be computed. The first grade average is simply the average of all four grades. The second grade average is computed by weighting the four grades as follows: the first grade gets a weight of 0.2, the second grade gets a weight of 0.3, the third grade a weight of 0.3, and the fourth grade a weight of 0.2; that is computed as:

0.3*grade1 + 0.2 *grade2 + 0.2 * grade3 + 0.3 * grade4

Using this information, you are to construct a 60 X 7 two dimensional array, in which the first column is

used for the student number, the next four columns for the grades, and the last two columns for the

computed final grades. The output of the program should be a display of the data in the completed

array. This program does NOT require user input (or "cin" function).

Student Grade 1 Grade 2 Grade 3 Grade 4
1 100 100 100 100
2 100 0 100 0
3 82 94 73 86
4 64 74 84 94
5 94 84 74 64

Your program should print the grade matrix, including the averages. Then it should calculate the mean and standard deviation for both averages for the class and print the results.

Program Organization:

The main() routine should declare and populate the array with the test data shown above. It should then

call a function, passing in the array as a parameter. The function should perform the calculations and print

the result.

Explanation / Answer

#define WIDTH 7

#define HEIGHT 60

calculate(int grade [HEIGHT][WIDTH]);

int main ()

{

int grade [HEIGHT][WIDTH];

int n,m;

for (n=0; n<HEIGHT; n++)

{

    for (m=0; m<WIDTH-2; m++)

    {

     if(n==0)

      {

       grade[n][m]=m+1;

      }

    else if(n==1)

   {

   }

    else if(n==2)

   {

   }   

    else if(n==3)

   {

   }   

     else if(n==4)

   {

   }   

       

      }

}

Calculate(grade);

}

Void calculate(int grade[][])

{

int a1=0;

int a2=0;

int finalavg[60];

for (n=0; n< HEIGHT; n++)

{

    for (m=1; m< WIDTH-2; m++)

    {

       a1=a1+grade[n][m];

    }

    a1=a1/4;

   finalavg[n]=a1;

}

for (n=0; n< HEIGHT; n++)

{

    for (m=5; m<=5; m++)

    {

      grade[n][m]=finalavg[n];

    }

}

int finalavg3[60];

for (n=0; n< HEIGHT; n++)

{

   Int f1=0;,f2=0;

    for (m=1; m< WIDTH-2; m++)

    {

      If(m==1&& m==4)

      {

        f1= f1+ grade[n][m];

      }

      Else

      {

       f2= f2+ grade[n][m];

      }

         }

Int f3=0;

f3=0.2(f1)+0.3(f2);

finalavg3[n]=f3;

}

for (n=0; n< HEIGHT; n++)

{

    for (m=6; m<=6; m++)

    {

      grade[n][m]=finalavg3[n];

    }

}

for (n=0; n<HEIGHT; n++)

{

    for (m=0; m<WIDTH; m++)

    {

         Cout >>””>>grade[n][m];

    }

}

Int mean=0;

for (n=0; n<HEIGHT; n++)

{

mean=mean+finalavg[n];

}

Cout>>”Mean is ”>> mean;

double temp=0;

for (n=0; n<HEIGHT; n++)

{

}

}

}

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