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

Your program will take its input from this file and sendit’s output to the scree

ID: 3618458 • Letter: Y

Question

Your program will take its input from this file and sendit’s output to the screen. The output will be the name of thestudent and his/her average all on one line on the screen. Use thefile “quizgrade.txt”. (s.c. andcode)

_______________________________________________________________

These are the names and 5 quiz scores that contain in the filename “quizgrade.txt”

Knoxville Jonny 100 25 34 48 15
Margera Bam 54 88 98 97 97
Vo Steve 91 95 56 87 65
Pontius Chris 87 89 91 65 45
Dunn Ryan 87 91 91 92 85
England Dave 87 89 99 100 100
Lacy Preston 0 0 12 12 78
Peepaw Pi 98 48 78 65 50
Maryland Drew 98 54 100 100 100
Viva Labam 45 97 32 87 25
Home Wrecker 100 50 100 50 100
Blasta zoid 1 2 3 4 5

ANS: This is what I have done so far please help me out with thelogic part.

#include<iostream>

#include<fstream>

#include<string>

using namespace std;

void main()

{

      int count, num, sum, average;

      char name [20];

      ifstream infile;

      infile.open("roster.txt",ios_base::in);

      infile >> name;

      if (infile.fail())

      {

           cout<<" Your File can not be opened."<<endl;

           exit(1);

      }

      while (infile)

     

           {

                 sum=sum+num;

                 count++;

                 infile>>num;

           }

           

      infile.close();

      system ("pause");

}

Explanation / Answer

please rate - thanks #include #include #include using namespace std; int main() {       int i, num, sum;       double average;       char name [20];       char first[20];       ifstream infile;       infile.open("quizgrade.txt",ios_base::in);            if (infile.fail())       {            cout