This exercise is meant to familiarize you with the following concepts discussed in class and your reading:
| Target. Make a class that represents a target with a given number of circles, each one smaller than the previous one. For example, if the target had three circles, the first should be the full size, the next two-thirds that size, and the last one, one-third that size. Similarly, if the target has five circles, the first should be full size, the next four-fifths that size, the next three-fifths, then two-fifths, and finally one-fifth the size. You should also create an Applet class within which you create an instance of your Target class. Your solution must be recursive; here is some sample psuedocode to get you started. |
| Circle Art. Make a class that represents a design of circles, with a given size, like the one shown below for a size of 360. Each circle design made should include four circles of one-third the original size. Finally, when it is too small to repeat the process, you should simply draw a green rectangle where you would have drawn another circle shape (for example when the size of the circle is less than ten pixels). |
| Sierpinski Triangle. This design is called Sierpinski's Triangle, after the Polish mathematician Waclaw Sierpinski who described some of its interesting properties in 1916. Among these is its fractal or self-similar character. The large triangle consists of three smaller triangles, each of which itself consists of three smaller triangles, each of which consists of three smaller triangles. At each level, the triangles to be created are half the size of the previous level. Note, this is different from the problem above in which a circle is created at each level because only the smallest triangles are drawn in this model. |
When you are finished, you and your partner should transfer the entire project folder created by Visual J++ to your respective public_html/cps4 folder in the acpub system and update your course web page to link to the newly transferred project using the guidelines given here.