void MailBoxes::processMail(istream & input) // precondition: input is formatted correctly, is open for reading, // and is positioned at the beginning of the file; // the file contains no more than MAX_BOXES different // P.O. box numbers { int box; while (input >> box) { int index = boxIndex(box); if (index != -1) { myBoxes[index].mailCount++; } else { myBoxes[myBoxCount].POBox = box; myBoxes[myBoxCount].mailCount = 1; myBoxCount++; } } }