< previous page page_954 next page >

Page 954
    GetID(idNum);
    while (idNum >= 0)
    {
            // Invariant (prior to test):
            //     Time cards for all previous values of idNum
            //     have been looked up

        punchInList.BinSearch(idNum, punchInCard, found);
        if (found)
        {
            punchInCard.Print();
            cout << endl;
        }
        else
            cout << idNum <  has not punched in yet. < endl;
        GetID(idNum);
    }
    return 0;
}

//******************************************************************

void OpenForInput( /* inout */ ifstream& someFile )    // File to be
                                                       // opened
// Prompts the user for the name of an input file
// and attempts to open the file

{
   .
   .    (Same as in previous case studies)
   .
}

//******************************************************************

void GetID( /* out */ long& idNum )    // Employee ID number

// Prompts for and reads an employee ID number

// Postcondition:
//     idNum == value read from standard input

{
    cout << endl;
    cout << Enter an employee ID (negative to quit): ;
    cin >> idNum;
}

 
< previous page page_954 next page >