Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Written in Python 3 ONLY Project Problem 02: Draw House (80 points) The Problem This part of project will give you more experience with defining

Written in Python 3 ONLY

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

Project Problem 02: Draw House (80 points) The Problem This part of project will give you more experience with defining classes and using inheritance. In this part, you are going to use turtle graphics to define some elementary shapes that know how to draw themselves. You are going to create at least 3 classes. Using instances of these classes, you are going to draw a simple picture. Your Task i. You will define at least three classes: A Triangle class, a Rectangle class, and a Circle class. 2. Instances of each class respond to at least the following methods: a. init create an instance of the class from the following i. For a Triangle: three pairs of coordinates, which indicate the three vertices (not a list, but three arguments, which you may give some default values for easy testing) ii. For a Rectangle: two pairs of coordinates-one giving the coordinates of the lower left corner and the other giving the coordinates of the top right corner (not a list, but two arguments) iii. For a Circle: a coordinate pair giving the center of the circle and a float giving the radius iv. For all, a string indicating a fill color (default value the empty string) v. For all, a string indicating the line color (default value "black b. Str conversion to a string, returns the string to be used for printing in the Python shell. c. draw: will take a turtle.Turtle object and will use it for drawing the shape; 3. All classes, methods and functions require a docstring for a general description of the object/method/function. (see docstring note below) 4. Triangle and Rectangle should both inherit from Polygon and reuse what they can from Polygon. Project Problem 02: Draw House (80 points) The Problem This part of project will give you more experience with defining classes and using inheritance. In this part, you are going to use turtle graphics to define some elementary shapes that know how to draw themselves. You are going to create at least 3 classes. Using instances of these classes, you are going to draw a simple picture. Your Task i. You will define at least three classes: A Triangle class, a Rectangle class, and a Circle class. 2. Instances of each class respond to at least the following methods: a. init create an instance of the class from the following i. For a Triangle: three pairs of coordinates, which indicate the three vertices (not a list, but three arguments, which you may give some default values for easy testing) ii. For a Rectangle: two pairs of coordinates-one giving the coordinates of the lower left corner and the other giving the coordinates of the top right corner (not a list, but two arguments) iii. For a Circle: a coordinate pair giving the center of the circle and a float giving the radius iv. For all, a string indicating a fill color (default value the empty string) v. For all, a string indicating the line color (default value "black b. Str conversion to a string, returns the string to be used for printing in the Python shell. c. draw: will take a turtle.Turtle object and will use it for drawing the shape; 3. All classes, methods and functions require a docstring for a general description of the object/method/function. (see docstring note below) 4. Triangle and Rectangle should both inherit from Polygon and reuse what they can from Polygon

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

Automating Access Databases With Macros

Authors: Fish Davis

1st Edition

1797816349, 978-1797816340

More Books

Students also viewed these Databases questions

Question

Know how productivity improvements impact quality and value.

Answered: 1 week ago

Question

Recommend the key methods to improve service productivity.

Answered: 1 week ago