|
-
December 27th, 2011, 06:21 AM
#1
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)
*****
*****
*****
*****
*****
-
December 28th, 2011, 10:16 AM
#2
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.
-
December 28th, 2011, 01:10 PM
#3
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|