void staff() { Var *varList = pushVar(); holdNum = returnBook(); if (0 <= holdNum) printf("[Number of books borrowed: %d]\n", holdNum); else printf("ERROR! You are trying to return more books than you've borrowed!\n"); holdNum = borrowBook(); if (0 <= holdNum) printf("[Number of books borrowed: %d]\n", holdNum); else printf("ERROR! You are trying to borrow more books than your borrowing limit!\n"); popVar(varList); }
void main () { startDay(sFile2); populateTextfile(sFile1); int i; do { printf("----------------------------------------------------\n"); printf("Push 1 to sell item.\n"); printf("Push 2 to return item.\n"); printf("Push 3 to search stock on system.\n"); printf("Push 4 to update stock.\n"); printf("Push 5 to print all stock to screen.\n"); printf("Push 6 to see cash in till for today only.\n"); printf("Push 7 or higher to quit the program.\n"); printf("?: "); scanf("%d", &i); switch (i) { case 1: printf("\n----------------------------------------------------\n"); sellItem(sFile1, sFile2); printf("----------------------------------------------------\n\n"); break; case 2: printf("\n----------------------------------------------------\n"); returnBook (sFile1, sFile2); printf("----------------------------------------------------\n\n"); break; case 3: printf("\n----------------------------------------------------\n"); stockSwitch(); printf("----------------------------------------------------\n\n"); break; case 4: printf("\n----------------------------------------------------\n"); updateStock(); printf("----------------------------------------------------\n"); break; case 5: printf("\n----------------------------------------------------\n"); printItem(sFile1); printf("----------------------------------------------------\n\n"); break; case 6: printf("\n----------------------------------------------------\n"); cash(sFile2); printf("----------------------------------------------------\n\n"); break; case 9: rofl(); break; } } while (i<7 && i!=9); populateTextfile(sFile1); endStatement(sFile2); }