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

We have a homework assignment but I have been out sick and have no idea what I a

ID: 3625369 • Letter: W

Question

We have a homework assignment but I have been out sick and have no idea what I am supposed to do!!!

Problem Definition
Design a grade calculation program to input numeric scores earned by a set of
fifty students on a graded activity, then compare each score to a (computed)
class average to determine a normative grade.

Input (console or file named score.txt)
For each student, input a score to be stored as an element in an array for
integers.

Output (screen)
Print a descriptive title line followed by headings above columns for student
serial numbers (values 0, 1, ...), scores, and grades.

Processing
Input and store the set of score values as an array of integers. Grades titles
are to be determined after input. Compute an average (int) for the entire set
of scores by summing the element values in the score array and dividing that
sum by the score count. Determine and assign individual grades by comparing
each score to the class average and assigning the string value "excellent",
"satisfactory", or "unsatisfactory" as the grade according to the following rules:
a. If a score is 10 or more points greater than the class average, assign the
grade "Excellent"; or
b. If a score is within 10 points above or below the class average, assign
the grade "satisfactory"; or
c. If the score is 10 or more points less than the class average, assign the
grade "unsatisfactory".

Data for score.txt (to save effort on input, copy and paste to the "command" line):
46 0 94 95 98 0 96 87 90 04 86 86 95 97 74 61 86 0 93 51 90 86 88 54 90
71 63 90 88 95 84 75 94 78 96 0 69 97 94 59 91 88 76 95 97 94 65 97 43 86

Explanation / Answer

please rate - thanks

any questions message me

#include <iostream>
#include <fstream>
using namespace std;
   int main()
   {char filename[80];
   int num[50],i,sum=0,numGrades=50;
   int average;
   ifstream input;
   cout<<"enter filename(ctrl^Z for console): ";   //only way I could figure out to get
   cin>>filename;                                  //filename or go to numbers
   if(filename[0]!=-16)      //-16 is int value of ASCII ctrl^Z
   {input.open(filename);        
      if(input.fail())           
          { cout<<"file did not open please check it ";
           system("pause");
          return 1;
          }
       for(i=0;i<numGrades;i++)
            input>>num[i];
       input.close();    
       }
   else
      {cin.clear();      //since simulated endo of file with CTRL^Z must reset input
      cout<<"Enter 50 grades: ";
      for(i=0;i<numGrades;i++)
            cin>>num[i];
      }
  
     
       for(i=0;i<numGrades;i++)
            sum+=num[i];
       average=sum/numGrades;
       cout<<"n grade rating ";
       for(i=0;i<numGrades;i++)
           {cout<<i<<" "<<num[i]<<" ";
           if(num[i]>=average+10)
              cout<<"Excellent ";
           else if(num[i]>=average-10&&num[i]<=average+10)
              cout<<"satisfactory ";
           else
              cout<<"unsatisfactory ";
              }
       cout<<"average: "<<average<<endl;
         system("pause");
         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