This assignment will give you more experience on the use of:
- class methods
In this project, you are going to use turtle graphics to draw one or more “snow persons.” You will define and use at least 7 classes in doing so. Using instances of these classes, you will write a main() function that creates and draws one or more snow people.
- Define a minimum of 7 classes. Most can be classes for geometric shapes (e.g., Line, Rectangle, Circle, Triangle), but 3 must be “drawing-specific” classes (see #5).
- Each class will have at least the following methods:
- __init__: the constructor will take arguments indicating the positions (coordinate pairs, e.g., (0.0, 0.0)) of one or more reference points (e.g., start and end points for a line, vertices for a triangle, etc); and other arguments appropriate for an instance (e.g., pen color, fill color, etc.). To simplify creating instances, it will define appropriate default values for most of the (If the argument for fill color is the empty string (“”), the shape is not filled.)
- __str__ : a conversion method, it returns the string to be used for printing an instance in Python.
- draw : the draw method will take a turtle.Turtle object to use for drawing the shape.
- Other arguments may be required for your methods; all arguments will be described in your docstrings.
- All classes, methods and functions require a docstring for a general description of the object/method/function.
- Define a main function that is called without any arguments. Your main function should create and draw one or more snow people at different positions on the canvas.
- Define a drawing-specific class hierarchy containing (at least) 3 classes:
- Snow_person : an instance contains (at least) the 3 snowballs
- Snow_man : specializes a Snow_person with a handful of additional components (e.g., arms, buttons, head wear)
CS 61002 Algorithms and Programming I
- Snow_lady : specializes a Snow_person with an alternate set of additional components.
- At a minimum, a snow person should include three snowballs, drawn one on top of the other, and two eyes and a mouth. Feel free to personalize your classes to include other components.