corner. As either the x and/or increases, the shape will move right and/or down.
Note: When you compile the Canvas.java class, you may have noticed that you receive the
following warning (or something similar):
Note: Canvas.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
The provided Cass class uses the deprecated JApplet class. You can ignore this warning,
and it does not indicate that anything is wrong with your code.
You will be responsible for filling in the FractalDrawer class. For full credit, your program should
have the following features:
Ask the user for input (choices: "circle", "triangle", or "rectangle") and use the corresponding
shape as the base of your fractal.
• Draw a pattern that repeats on itself at least 7 times and uses a new color in each repetition
(feel free to be creative - you can cycle colors or choose colors at random, as long as overlapping
shapes are distinct from one another).
IMPORTANT: The pattern must repeat on itself using recursion for full credit.
Changing a shape's size or position should be involved in recursive calls.
• Draw at least four shapes per layer for rectangles and circles and at least three per lager
for triangles (e.g. draw the new shapes on all three points or sides of a triangle, or on four
opposite sides of a circle- again, feel free to be creative).
● Compute the total area of all shapes that form your fractal and print the result to the screen
after your program is finished drawing. You do not need to take into account any overlap,
CSCI 1933 PROJECT 1
4. GRADING INFORMATION
simply sum the area of all the shapes that were drawn, even if they overlap each other.
To receive full credit, your program will need to be able to draw a fractal using recursion for
all three possible inputs (circle, triangle, or rectangle). We suggest that the most convenient
implementation is to simply implement three different methods, one that draws a circle fractal, one
that draws a triangle fractal, and one that draws a rectangle fractal.
Note: If nothing appears on the canvas when you run your program, or of only a partial
fractal appears, try resizing the camas window. If you need to do this to display the entire
fractal, you will not be penalized. The TAs are aware that many fractals will only appear
after resizing the window.
Fig: 1