Starting from:

$30

Program 3: Fractal Fern

CPSC 212: Data Structures and Algorithms
Program 3: Fractal Fern
In this project you will write a program to draw a fractal of your own design, with parameters
controlled by sliders. You should base your program on the code handed out to you in class, but
you should revise it to try to make it look like a fractal fern. Try to make it look realistic. As
another option with up to 90% credit, you can make a fractal of any sort using this framework--
perhaps a fractal flower, tree, fireworks, Jack-O-Lantern, or just an interesting shape etc. It can
be realistic or fanciful.
In either case, you should use randomness in three different ways in your program, and you
should use three sliders to control aspects of the appearance of your fractal. You should use
three different types of shapes somewhere in your fractal: lines, ellipses, or polygons. As an
option, you can use images in place of one of the other primitives, for example, for a
background, flowerpot, or berry. (Look into documentation on the C# WPF Brush class for info
on how to use an image.)
To get started with this project, open a new WPF project in Visual Studio. (Don’t use Console
App or Windows Forms or other project types.) If you want to compile the sample code, delete
the C# source code in the .cs file and paste in the contents of Fern.cs. Delete the contents of the
.xaml file and paste in Fern xaml. Then build and run. Alternative, just start from scratch looking
at the example for how to create some graphical primitives.
Turn in: Turn in a program grading sheet (other side of this page). Also submit your project
directory in a zipfile to moodle. Don’t forget to use good programming style, including
whitespace, indenting, good variable names, and helpful comments. Document the input
requirements and results of functions. 10% of the final grade will be based on programming
style.
Viewing: We will view results in class, with the class selecting its favorite. There may even be a
prize for the winner! Let me know by email if you don’t want your program shown. Late
programs may not be eligible for the prize.
Program 3 – Grading Sheet
Name: ___________________________Section___ Date turned in: _________ Late? _____
Parts of the program I didn’t get to work:
Comments on this assignment:
______________________________For Grader’s Use________________________________
• Program compiles and runs (30) _____
• Program displays a fractal, with self-similarity at different levels (20) _____
• Program has sliders that control three parameters of the rendering (10) _____
• Program uses three types of randomness and three primitives (10) _____
• Program displays a realistic-looking fern (10) _____
• Program uses good programming style (10) _____
• Mechanics: turn in printout with grading sheet; submit electronically (10) _____
Total (100) _____

More products