Question: #include #include using namespace std; // Erik Donovan const int MAXNAME = 20; int main() { ifstream inData; inData.open(grades.txt); char name[MAXNAME + 1]; // holds

#include #include using namespace std;

// Erik Donovan

const int MAXNAME = 20;

int main() { ifstream inData; inData.open("grades.txt");

char name[MAXNAME + 1]; // holds student name float average; // holds student average char studentName;

inData.get(name, MAXNAME + 1); while (inData) { inData >> average; inData >> studentName; cout << studentName << " has a(n) average of" << average << endl; // FILL IN THE CODE to print out name and // student average

// FILL IN THE CODE to complete the while // loop so that the rest of the student // names and average are read in properly inData.ignore(100, ' ');

if (inData) { inData.get(name, MAXNAME + 1); cout << studentName << " has an average of" << average << endl; } cin.get(); system("pause"); return 0; } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!