All pastes #1675975 Raw Edit

Mine

public text v1 · immutable
#1675975 ·published 2009-11-18 05:21 UTC
rendered paste body
#include "search.h"

int main()
{
    int idnum, i;
    EmpData searchMe;

    searchMe.loadArrays();
    for (;;) {
        cout << "ID to search for: ";
        cin >> idnum;  //97854

        i = searchMe.seqSearch(idnum);
        if (i > -1) {
            cout << "Sequential found emp " << searchMe.dispArray1(i)
                 << ", and the rate is " << searchMe.dispArray2(i) << " per hour.\n";
        } else {
             cout << "Sequential: No records matching " << idnum << endl;
        }

        i = searchMe.binSearch(idnum);
        if (i > -1) {
            cout << "Binary found emp " << searchMe.dispArray1(i)
                 << ", and the rate is " << searchMe.dispArray2(i) << " per hour.\n\n";
        } else {
            cout << "Binary: No records matching " << idnum << endl << endl;
        }
    }

    return 0;
}