/*---------------------------------------------------------- Elizabeth Sklar Assignment #2 MC140.0X 25 September 2000 This program prints out graphical objects (using ASCII graphics), based on input from the user. The user selects objects to print from a menu. ----------------------------------------------------------*/ #include /*--------------------------------------------------------*/ /* get_option */ /* */ /* This function prints the menu and gets the user's */ /* choice of what to do. */ /* */ /*--------------------------------------------------------*/ char get_option() { char tmp[2]; printf( "R (draw rectangle)\n" ); printf( "T (draw triangle)\n" ); printf( "C (draw circle)\n" ); printf( "H (draw house)\n" ); printf( "Q (quit)\n" ); printf( "enter option: " ); scanf( "%s",tmp ); return( tmp[0] ); } /* end of get_option() */ /*--------------------------------------------------------*/ /* draw_rectangle */ /* */ /* This function draws a rectangle. The user is asked to */ /* specify the height and width of the rectangle. */ /* */ /*--------------------------------------------------------*/ void draw_rectangle() { int h, w; // height and width of rectangle int i, j; // loop counters // ask user for dimensions printf( "Please enter height of rectangle: " ); scanf( "%d",&h ); printf( "Please enter width of rectangle: " ); scanf( "%d",&w ); // draw the rectangle for ( i=0; i=0; i-- ) { for ( j=0; j