In this problem you will be creating a Caterpillar class that will draw a caterpillar using...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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 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
Expert Answer:
Answer rating: 100% (QA)
import turtle class Caterpillar display function will call other function to draw catterpillar def d... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
In this problem you will compute January 12 2004 bid and ask volatilities (using the Black-Scholes implied volatility function) for 1-year IBM options expiring the following January. Note that IBM...
-
In this problem you will compute January 12 2004 bid and ask volatilities (using the Black-Scholes implied volatility function) for 1-year IBM options expiring the following January. Note that IBM...
-
In this problem you will generate a graph similar to Figure. The table below shows the standard deviation for various portfolios of stocks listed in Table 6.5. Plot the relationship between the...
-
Suppose that, in an attempt to raise more revenue, Nowhere State University (NSU) increases its tuition. Will this necessarily result in more revenue? Under what conditions will revenue (a) rise, (b)...
-
Discuss the scope of ERP and difficulties in implementation.
-
Halimas financial year ends on 31 October. She depreciates her motor vehicles using the reducing balance method at 20% per annum. On 1 November 206 she bought a motor vehicle for $14,200. What was...
-
Explain the available defenses for defendants as it relates to informed consent.
-
As a second-year financial analyst for A.J. Straub Investments, you are performing an initial analysis on Reliant Pharmaceuticals. A difficulty youve encountered in making comparisons with its chief...
-
Required Information Problem 17-2A (Algo) Ratios, common-size statements, and trend percents LO P1, P2, P3 [The following information applies to the questions displayed below.)] Selected comparative...
-
How would the companys cash needs change for the company in Examples 14-1 to 14-5 if the third project started in May instead of February and the retention was not released until the following year?
-
Wells and Family Ltd operates a duck farm on the outskirts of Melbourne. At the commencement of the 2021/22 financial year the following ducks were owned: Mature ducks with a fair value of $55,000...
-
What is the greatest length of a metal wire that can be hung vertically under its own weight? If the allowable stress in the metal of wire is \(3 \mathrm{MPa}\) and density of metal is \(12 \times...
-
Explain with neat sketch the principle and construction of vapor absorption refrigeration system.
-
You just learned about the use of technology in business. Consider how this content relates to other areas of business. How would you find the balance between a new hardware or software rollout and...
-
Explain the working of domestic refrigeration system with a neat sketch?
-
During testing of single cylinder two-stroke petrol engine, following data were obtained-brake torque \(=640 \mathrm{Nm}\); cylinder diameter \(=21 \mathrm{~cm}\), speed \(=250 \mathrm{rpm} ;\)...
-
Bread Box, Inc. finances its operations using $1.50 of debt for every $2 of common stock. The pre- tax cost of debt is 7.5 percent, the cost of equity is 11 percent, and the tax rate is 34 percent....
-
Bobbie Singh provides writing services for small businesses. He blogs for companies that need professionally written content. His business records at November 15, 2023, are shown below: During the...
-
Make a drawing indicating the four-step process d of Figure 8.4 in Figure 8.13. Figure 8.4 Figure 8.13 Critical- point Liquid Solid Triple point Gas Tm Temperature Pressure/bar Critical point P....
-
Devise a temperature scale, abbreviated G, for which the magnitude of the ideal gas constant is 5.52 J G 1 mol 1 .
-
From the data in Table 10.3 (see Appendix B, Data Tables), calculate the activity of the electrolyte in 0.200 m solutions assuming complete dissociation of a. KCl b. Na 2 SO 4 c. MgCl 2
-
That financial ratios are most valuable when viewed in comparison to the organizations historical ratio values and competitors values. Why is this context valuable when examining financial ratio...
-
What are the five forms of financing, and how is each used within sport?
-
For many years, womens professional basketball struggled for consistency in the United States. Since 1978, when the Womens Professional Basketball League (WBL) was formed, leagues have had difficulty...
Study smarter with the SolutionInn App