#include #define TRUE 1 #define FALSE 0 #define DISPLAY_SUBMENU -1 #define DISPLAY_MENU 0 #define PRINT_PUMPKIN 1 #define INC_HEIGHT 2 #define DEC_HEIGHT 3 #define INC_WIDTH 4 #define DEC_WIDTH 5 #define CHOOSE_EYES 6 #define CHOOSE_NOSE 7 #define CHOOSE_MOUTH 8 #define EXIT_PROGRAM 9 #define NUM_MAIN_MENU_OPTIONS 10 #define FOREHEAD_HEIGHT 4 #define EYE_HEIGHT 3 #define NOSE_HEIGHT 3 #define MOUTH_HEIGHT 3 #define CHIN_HEIGHT 2 #define MIN_HEIGHT (FOREHEAD_HEIGHT + EYE_HEIGHT + NOSE_HEIGHT + MOUTH_HEIGHT + CHIN_HEIGHT) #define MAX_HEIGHT (2 * MIN_HEIGHT) #define MIN_WIDTH 0 /* Replace this with a reasonable value. */ #define MAX_WIDTH (2 * MIN_WIDTH) #define ERROR_MESSAGE "This statement should never be displayed!\n" #define EXIT_MESSAGE "Thank you for using PDA. Goodbye.\n" void PrintMenu(void); void PrintCurrentDimensions(int wd, int ht); int main(void) { int width = MIN_WIDTH, height = MIN_HEIGHT; int menuOption; PrintCurrentDimensions(width, height); PrintMenu(); menuOption = EXIT_PROGRAM; switch (menuOption) { case DISPLAY_MENU: /* You do not need to add any code here. */ PrintMenu(); break; case PRINT_PUMPKIN: /* Add your code here. */ break; case INC_HEIGHT: /* Add your code here. Do not remove the call to PrintCurrentDimensions. */ PrintCurrentDimensions(width, height); break; case DEC_HEIGHT: /* Add your code here. Do not remove the call to PrintCurrentDimensions. */ PrintCurrentDimensions(width, height); break; case INC_WIDTH: /* Add your code here. Do not remove the call to PrintCurrentDimensions. */ PrintCurrentDimensions(width, height); break; case DEC_WIDTH: /* Add your code here. Do not remove the call to PrintCurrentDimensions. */ PrintCurrentDimensions(width, height); break; case CHOOSE_EYES: /* Add your code here. Do not remove the call to PrintMenu. */ PrintMenu(); break; case CHOOSE_NOSE: /* Add your code here. Do not remove the call to PrintMenu. */ PrintMenu(); break; case CHOOSE_MOUTH: /* Add your code here. Do not remove the call to PrintMenu. */ PrintMenu(); break; case EXIT_PROGRAM: /* Add your code here. */ break; default: printf(ERROR_MESSAGE); } printf(EXIT_MESSAGE); return 0; } /* * PrintMenu * --------- * Input: n/a * Output: n/a * Displays the main menu. * NOTE: Do NOT modify this function. */ void PrintMenu(void) { printf("Choose an option:\n"); printf("-----------------\n"); printf("0 = Display This Menu\n"); printf("1 = Print\n"); printf("2 = Increase Height\n"); printf("3 = Decrease Height\n"); printf("4 = Increase Width\n"); printf("5 = Decrease Width\n"); printf("6 = Choose Eyes\n"); printf("7 = Choose Nose\n"); printf("8 = Choose Mouth\n"); printf("9 = Exit Program\n"); } /* * PrintCurrentDimensions * ---------------------- * Input: * wd = The current width * ht = The current height * Output: n/a * Displays the pumpkin's current width and height. * NOTE: Do NOT modify this function. */ void PrintCurrentDimensions(int wd, int ht) { printf("Current dimensions = %dx%d\n", wd, ht); }