Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

python

image text in transcribed

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: I. 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 . Your display function should call 3 helper function (these will be extremely helpful in problem D) o draw_body0 this function should draw the body of the Caterpillar (the green overlapping circles) draw_antennae0 this function should draw the antennae on the Caterpillars head n draw_legs0 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 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: I. 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 . Your display function should call 3 helper function (these will be extremely helpful in problem D) o draw_body0 this function should draw the body of the Caterpillar (the green overlapping circles) draw_antennae0 this function should draw the antennae on the Caterpillars head n draw_legs0 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

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems For Advanced Applications 17th International Conference Dasfaa 2012 Busan South Korea April 2012 Proceedings Part 1 Lncs 7238

Authors: Sang-goo Lee ,Zhiyong Peng ,Xiaofang Zhou ,Yang-Sae Moon ,Rainer Unland ,Jaesoo Yoo

2012 Edition

364229037X, 978-3642290374

More Books

Students also viewed these Databases questions

Question

Guidelines for Informative Speeches?

Answered: 1 week ago