void GradeInfo::Read(istream & input) // precondition: input is open for reading // postcondition: myGrades contains the frequency count of // each grade in input, // myCount contains the total number of grades // in input { int k,index; char ch; // initialize all counters to 0 for(k=0; k < NUM_GRADES; k++) { myGrades[k] = 0; } // read file while (input >> ch) { index = CharToIndex(ch); // map char to an index myGrades[index]++; // bump # occurrences myCount++; // bump total count } }