// BIB_MAIN.CPP #include "bib_item.h" #include "myio.h" #include MyIO Crt; int main() { char c; char type[ SSize ]; char A[ SSize ]; char T[ SSize ]; char Selection; Bib_Item Bib_Cards; Loader( &Bib_Cards ); // MENU LOOP do { Crt.ClearScr(); cout << "\n\t----------------- BIB. ITEM MENU -----------------\n\n"; cout << "\t\t 1.) Show ALL Types \n" << "\t\t 2.) Show All of a Type \n" << "\t\t 3.) Show a Single Card \n\n" << "\t\t A.) Add a Item \n" << "\t\t D.) Delete a Item \n\n" << "\t\t H.) HELP \n" << "\t\t M.) Memory Check \n" << "\t\t Q.) Quit this Program \n" << "\n\t\t <<== Enter Choice \r\t\t " ; Selection = Crt.GetChar(); cout << "\n"; switch( Selection ) { case '1': Bib_Cards.Print(); Crt.Pause(); break; case '2': cout << "\n\t Valid SHOW Types: BOOK : MAG : MICROFILM : \n" << " \n\t Enter Type ==>"; strcpy( type, NULL ); cin.get( type, SSize, NewLine ); cin.get( c ); Bib_Cards.Print( type ); Crt.Pause(); break; case '3': cout << "\n\t Valid SHOW Types: BOOK : MAG : MICROFILM : \n" << " \n\t Enter Type ==>"; strcpy( type, NULL ); cin.get( type, SSize, NewLine ); cin.get( c ); Bib_Cards.Print( type ); cout << " \n\t Enter Author ==>"; strcpy( A, NULL ); cin.get( A, SSize, NewLine ); cin.get( c ); cout << " \n\t Enter Title ==>"; strcpy( T, NULL ); cin.get( T, SSize, NewLine ); cin.get( c ); Bib_Cards.Print( type, A, T ); Crt.Pause(); break; case 'A': cout << "\n\t Valid ADD Types: BOOK : MAG : MICROFILM : \n" << "\n\t Enter Type ==>"; strcpy( type, NULL ); cin.get( type, SSize, NewLine ); cin.get( c ); cout << "CURRENTLY: "; Bib_Cards.Print( type ); cout << "\n\t Enter Author ==>"; strcpy( A, NULL ); cin.get( A, SSize, NewLine ); cin.get( c ); cout << "\n\t Enter Title ==>"; strcpy( T, NULL ); cin.get( T, SSize, NewLine ); cin.get( c ); Bib_Cards.Add( type, A, T ); Crt.Pause(); break; case 'D': cout << "\n\t Valid DELETE Types: BOOK : MAG : MICROFILM : \n" << "\n\t Enter Type ==>"; strcpy( type, NULL ); cin.get( type, SSize, NewLine ); cin.get( c ); cout << "CURRENTLY: "; Bib_Cards.Print( type ); cout << "\n\t Enter Author ==>"; strcpy( A, NULL ); cin.get( A, SSize, NewLine ); cin.get( c ); cout << "\n\t Enter Title ==>"; strcpy( T, NULL ); cin.get( T, SSize, NewLine ); cin.get( c ); Bib_Cards.Delete( type, A, T ); Crt.Pause(); break; case 'M': Crt.MemChk(); Crt.Pause(); break; case 'H': Crt.ClearScr(); system( "type bib_item.txt | more" ); system( "pause" ); // Crt.Pause(); break; case 'Q': cout << "\n End Program? ( Y or N ) "; if( Crt.GetChar() == 'Y' ) { cout << "\n"; Crt.Pause(); Crt.ClearScr(); exit( 0 ); } cout << "\n"; Crt.Pause(); break; } } while( 1 ); } // BIB_MAIN.CPP // END //