CS 61002 Algorithms and Programming I Solved

25.00 $

Category:
Click Category Button to View Your Next Assignment | Homework

You'll get a download link with a: . zip solution files instantly, after Payment

Description

5/5 - (2 votes)

Project Objectives

This assignment will give you more experience on the use of:

  1. classes
  2. class methods
  3. inheritance

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.

 

Project Specification

  1. 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).
  2. Each class will have at least the following methods:
    1. __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.)
    2. __str__ : a conversion method, it returns the string to be used for printing an instance in Python.
    3. draw : the draw method will take a turtle.Turtle object to use for drawing the shape.
    4. Other arguments may be required for your methods; all arguments will be described in your docstrings.

 

  1. All classes, methods and functions require a docstring for a general description of the object/method/function.

 

  1. 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.

 

  1. Define a drawing-specific class hierarchy containing (at least) 3 classes:

 

  1. Snow_person : an instance contains (at least) the 3 snowballs

 

  1. Snow_man : specializes a Snow_person with a handful of additional components (e.g., arms, buttons, head wear)

 

 

CS 61002 Algorithms and Programming I

  1. Snow_lady : specializes a Snow_person with an alternate set of additional components.

 

  1. 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.

 

 

  • snow_man.zip