CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Threaded View

  1. #3
    Join Date
    Mar 2008
    Posts
    2

    Re: minor problem with height

    Code:
    } while (height >= 3);
    should be:

    Code:
    } while (height >= 0);
    or height!=-1 depending on if you want any negative number or just -1 to be the kill switch




    Code:
    	cout << "Enter the character to fill the rectangle with: ";
    	symbol = Get_Character();
    	
    	Draw_Rectangle(height, width, symbol);
    	Draw_Top_Bottom(width);
    	cout << endl;
    	Draw_Middle(height, width, symbol);
    	Draw_Top_Bottom(width);
    should be moved inside the if (height > 3) statement after the do-while





    Code:
           else if ((height < 3) && (height < 3))
    it doesnt affect anything but this should be changed to:

    Code:
           else if (height < 3)



    Code:
              else
              {
              exit (1);
              }
    can be removed. the do-while will take care of breaking out of the loop




    Code:
    	cout << endl << "Enter the height at the first prompt and the width at the second!" << endl << "Type a negative for the first prompt to exit!";
    	cout << endl;
    can be moved to the first line of the do-while so it doesnt give you the extra message after you enter -1



    i believe that should fix everything. i dont have a compiler so i cant check but if there are any problems with my suggestions it shouldnt be too hard to fix

    edit: added code tags and made it look pretty etc.
    Last edited by Anjar; March 13th, 2008 at 10:23 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured