Question: *JAVA PROGRAM* Write a program to draw one of four recusively defined patterns. These are the patterns: In each pattern a smaller square is drawn

*JAVA PROGRAM*

*JAVA PROGRAM* Write a program to draw one of four recusively defined

Write a program to draw one of four recusively defined patterns. These are the patterns: In each pattern a smaller square is drawn at each of the four corners of the next larger square. This pattern repeats again and again. It might repeat any number of times or levels. In the pictures above, the pattern is repeated four times or levels. If another level were asked for, then 192 very small squares would have to be drawn. The patterns differ in which squares are drawn on top of the others and thus may be hidden from view. The largest square, the one at level one, is drawn in the center of a square canvas and the length of its side is one half the length of the side of the canvas. The center of the next smaller square is always at the corner of the larger square. And the size of the next smaller square is determined by a fixed ratio R. If the smaller square has a side of length s and the next larger square has a side of length b, then R is the ratio b/s. In the pictures above the ratio R is about 2.2. Input Read ratio R, level L and pattern number n(1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!