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

Thread: draw Rectangle

  1. #1
    Join Date
    Dec 2011
    Posts
    4

    draw Rectangle

    Hi guys,

    I need help.. I want to write a code for drawing me rectangles ..

    And I need to make 2 functions one for not fill rect and the other is for fill rect ..


    I just started to write some draft
    please any help be more then welcome ..


    public class Rectangle {
    private int width , height;
    public Rectangle (int w, int h) {
    width = w;
    height = h;
    }
    }

     
    for example   
    draw for (4,4)  
    
    ****
    * *
    * *
    ****
     

     
    drawFilled   for (5,5)
    
    *****
    *****
    *****
    *****
    *****

  2. #2
    Join Date
    May 2006
    Location
    UK
    Posts
    4,473

    Re: draw Rectangle

    The code you have supplied is full of unprintable characters.

    Please your post code in code tags and make sure you are using printable characters - I'm not sure what character sets are supported but you will definitely be ok if you stick to ASCII characters.
    Posting code? Use code tags like this: [code]...Your code here...[/code]
    Click here for examples of Java Code

  3. #3
    Join Date
    Jun 1999
    Location
    Eastern Florida
    Posts
    3,877

    Re: draw Rectangle

    For each method you need to have code that writes some * on a line.
    The method for the filled one writes the same number on each line.
    The method for the outline only writes a full line of * for the first and last line.
    For the inbetween lines, it writes a starting *, some blanks and and ending *
    Norm

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