/* Spring 2023 - lab 8 - printMenu.c

	continuation of Lab 7
	This time, the program will consist of multiple files with each function
	from last week's lab in a separate file.
	1. printMenu.c
	2. convertCase.c
	3. printArray.c

	The students will also create a defs.h which will contain the other 
	#include statement(s), prototypes, and #define or constants.


*/


#include "defs.h"


/* ------------------------------------------------------------ */
/* prints a menu to the user
   parameters:  none
	return:  the menu choice that the user enters
*/
int printMenu() {
	int choice = 0;
	do {
		// print a menu to the user
		printf("\nChoose from the menu: \n");
		printf("\t1. print the poem \n");
		printf("\t2. show number of lines in the poem\n");
		printf("\t3. convert the case\n");
		printf("\t4. search for a word\n");
		printf("\t5. quit\n\n");
		printf("\t - - > ");
		scanf("%d", &choice);
		printf("\n");
	} while( (choice != 1) && (choice != 2) &&
			   (choice != 3) && (choice != 4) &&
				(choice != 5) ); 

	return choice;
}
/* ------------------------------------------------------------ */


