Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

#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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Business Process Driven Database Design With Oracle PL SQL

Authors: Rajeev Kaula

1st Edition

1795532386, 978-1795532389

Students also viewed these Databases questions

Question

What are ISO 9000 and Six Sigma?

Answered: 1 week ago