//****************************************************************** // SPECIFICATION FILE (tclist.h) // This file gives the specification of TimeCardList, an ADT for a // list of TimeCard objects. //****************************************************************** #ifndef TCLIST_H #define TCLIST_H #include "timecard.h" #include <fstream> using namespace std; const int MAX_LENGTH = 500; // Maximum number of time cards class TimeCardList { public: void ReadAll( /* inout */ ifstream& inFile ); // Precondition: // inFile has been opened for input // Postcondition: // List contains at most MAX_LENGTH employee time cards // as read from inFile. (Excess time cards are ignored // and a warning message is printed) void SelSort(); // Postcondition: // List components are in ascending order of employee ID void BinSearch( /* in */ long idNum, /* out */ bool& found, /* out */ TimeCard& card ) const; // Precondition: // List components are in ascending order of employee ID // && idNum is assigned // Postcondition: // IF time card for employee idNum is in list // found == true && card == time card for idNum // ELSE // found == false && value of card is undefined TimeCardList(); // Postcondition: // Empty list created private: int length; TimeCard data[MAX_LENGTH]; }; #endif