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)...
-
The radius Rh of a black hole is the radius of a mathematical sphere, called the event horizon that is centered on the black hole. Information from events inside the event horizon cannot reach the...
-
What is the optimum line of sight?
-
One of the key features of CSF use is making the implicit into explicit, explain what this means in an operational context.
-
There are five horseracing tracks in Kentucky. The Kentucky legislature allows only one track to be open at a time. How does this restriction affect the price the track can charge for its product?
-
Identify the correct statement regarding integrated audits. Multiple Choice Evaluation of internal controls is excluded when performing an integrated audit. The term "integrated audit" refers to the...
-
The information listed below refers to the employees of Lemonica Company for the year ended December 31, 2018. The wages are separated into the quarters in which they were paid to the individual...
-
How does shifting from customer acquistion to alternative finance relate to international marketing Explain.
-
What are the two categories of assets?
-
What is the advantage of using the allowance method of accounting for uncollectible accounts? What is the advantage of using the direct write-off method?
-
What taxes are included in the quarterly federal tax return filed by the employer?
-
When must employers furnish a W-2 statement to their employees?
-
What is the amount of each employee's earnings that is subject to federal and state unemployment taxes at Hobby Shack?
-
When the following hypotheses are being tested at a level of significance of ? H 0 : ? ? 500 H a : ? > 500 the null hypothesis won't be rejected if the p -value is
-
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
-
Transatlantic Arbitrage. A corporate treasury working out of Vienna with operations in New York simultaneously calls Citibank in New York City and Barclays in London. The banks give the following...
-
Venezuelan Bolivar (A). The Venezuelan government officially floated the Venezuelan bolivar (Bs) in February 2002. Within weeks, its value had moved from the pre-float fix of Bs778/$ to Bs1025/$. a....
-
Venezuelan Bolivar (B). The Venezuelan political and economic crisis deepened in late 2002 and early 2003. On January 1, 2003, the bolivar was trading at Bs1400/$. By February 1, its value had fallen...
Study smarter with the SolutionInn App