Question: In this problem you will be creating a Caterpillar class that will draw a caterpillar using turtle graphics. Your caterpillar object will contain the

In this problem you will be creating a Caterpillar class that will draw a caterpillar using turtle graphics. Your caterpillar object will contain the following information: 1. Body color (default="green") 2. Legs color (default = "purple") 3. Body size (the radius of the 5 circles that make the caterpillars body) (default = 50) You are going to want to create a turtle object that you will use to draw the caterpillar in the constructor, but it is not a parameter required to create a caterpillar. Your Caterpillar class mus include a display function that will be where your caterpillar is called (display can call helper functions if you choose to split up the different parts you need to draw). Here is a sample caterpillar with all of the defaults (this picture is smaller than what it would look like in the tur window): Constraints: You must create a Caterpillar class (named Caterpillar) and include a display function (named display) to draw the caterpillar O Your display function should call 3 helper function (these will be extremely helpful in problem D) draw_body) this function should draw the body of the Caterpillar (the 5 green overlapping circles) draw_antennae() this function should draw the antennae on the Caterpillars head draw_legs() this function should draw the legs! You may only import turtle graphics (import turtle) You must use turtle.speed (0) in the display function or in the Caterpillar constructor before you draw the Caterpillar
Step by Step Solution
3.49 Rating (152 Votes )
There are 3 Steps involved in it
import turtle class Caterpillar display function will call other function to draw catterpillar def d... View full answer
Get step-by-step solutions from verified subject matter experts
