Hi every body

My teacher assinged us a lab to draw a 200 X 200 square at the top-left corner and the right bottom corner of the monitor then continue drawing squares that become steadily smaller as they are displayed to right side and left side of each preceding square. The bottom of the square stays at the same level. Each square is 25 percent smaller than the previously drawn square. The recursive process exits when it is true that either the square size becomes smaller than four pixels or the border of the monitor is reached.

The output shoud be similar to the picture at the end of the post

I am new to programming so please help me so I can start this program

Thank you in advance.

picture2

Recommended Answers

All 4 Replies

make a method that calls itself by incrementing or decrementing the value passed to it

will you be using threads here for the repaint?

Start by writing a program that just creates one square.
Then look at how you can change it to make the next square.

I draw a sequare but I couldn't draw the next sequare which has to be 25% smaller
please help me

Post the code that shows how you are drawing the square. It's parameters should control how it is drawn.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.