Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This assignment will give you more experience on the use of: 1. classes 2. class methods In this project, we are going to use a

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

1. classes 2. class methods

In this project, we are going to use a library package called turtle graphics to draw a car. We are going to create at least 5 classes. We are then going to write a function that creates instances of your classes in order to draw a car that includes: a body, wheels, windows, and an antenna. You can certainly provide more than 5 (taillights, headlights, windshield, wipers, grill, etc.), but 5 is a minimum.

Project Description / Specification Define 5 classes (at least).

1. Each class will have an __init__ and a draw() method: a. the __init__ method will take a string argument, either indicating a fill color or, if the argument is (the empty string), that the shape is not filled. b. the draw method will take at least x and y coordinates arguments (indicating where the figure is drawn) and a turtle.Turtle object to use for drawing the shape. c. Other arguments may be required for your methods; all arguments must be described in your docstrings.

2. Function car(pen, bodycolor) where pen is a turtle.Turtle object with which to draw the car and body color is the color of the car. Note: this function will be used by the grader to test your code so it is critical that it meets this specification.

3. Your car must, at a minimum, include the following classes: a. a body b. wheels c. windows d. an antenna e. at least one other (of your own design)

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

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

Data Management Databases And Organizations

Authors: Richard T. Watson

3rd Edition

0471418455, 978-0471418450

More Books

Students also viewed these Databases questions

Question

Describe how to train managers to coach employees. page 404

Answered: 1 week ago

Question

Discuss the steps in the development planning process. page 381

Answered: 1 week ago