#include #include #include #include void main(int argc, char* argv[]) { ifstream myInput(argv[1]); char* attribute = new char[100]; // stores the current attribute int sum = 0; int counter = 0; // read and process each attribute while (myInput >> attribute) { switch (counter++ % 3) { case 0: cout << "StudentNumber: " << attribute <<'\t'; break; case 1: cout << "LastName: " << attribute << " " <<'\t'; break; case 2: cout << "Grade: " << attribute << endl; // sum the grade of all the records sum = sum + atoi (attribute); } } cout << "sum of grades: " << sum << endl; myInput.close(); }