/*Typical driver outline (using C and pseudocode) for a menu driven program */ /* includes */ /* defines */ #define QUIT 5 /* prototypes for functions defined in the same file as main() */ void main(void) { /* declarations */ int choice; do { print_menu(); get_int_bound(&choice, 1, 5); /* assumes 5 options with 5 being quit */ switch(choice) { case 1: /* do whatever is appropriate */ break; case 2: /* do whatever is appropriate */ break; case 3: /* do whatever is appropriate */ break; case 4: /* do whatever is appropriate */ break; case QUIT: printf("\nYou have chosed to quit - Exiting program. \n\n"); } } while (choice != QUIT); } /*** NOTE: I defined QUIT to be 5 so that I could use the word QUIT in my switch statement instead of the value 5. The QUIT is more readable than 5. I could also define words for the other options if I wanted. ***/