-
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)
*****
*****
*****
*****
*****
-
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.
-
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 *