// library.h // ---------------------------------------------------------------------- // Do not modify this file. // // CSE 143 // Homework 2 // http://www.cs.washington.edu/education/courses/143/00su/homework/hw2/ // 25 Jun 2000 #ifndef _LIBRARY_H_ #define _LIBRARY_H_ #include "lbook.h" ////////////////////////////////////////////////////////////////////// // constants // in days const int LOAN_DURATION = 21; // overdue fines, in cents; used in computeFine const int FIXED_FINE = 75; const int PER_DAY_FINE = 15; // in printBookList and processTransactionsFile, display entries // this many at a time, so records don't scroll past top of window const int ENTRIES_PER_SCREEN = 4; ////////////////////////////////////////////////////////////////////// // prototypes // pauses until user types a non-whitespace character and Return void waitForChar(void); // computes fine in cents for a book overdue by given number of days; // see constants above int computeFine(int daysOverdue); // returns index of LibraryBook in bookList w/ ID matching given searchID int findBookByID(LibraryBook bookList[], int bookCount, int searchID); // reads given book catalogue file and writes elements of bookList, // assigning the number of book records read to bookCount void readBookFile(char fileName[], LibraryBook bookList[], int maxBookCount, int &bookCount); // reads given transaction log file and processes each transaction, // printing per-transaction data and overdue fine information, if // applicable void processTransactionsFile(char fileName[], LibraryBook bookList[], int bookCount); // prints book records, one screen at a time; // see ENTRIES_PER_SCREEN above void printBookList(LibraryBook bookList[], int bookCount); #endif // _LIBRARY_H_