Question: Using Python. Write a Class for Shape that Has the following attributes: . height o width #represents the height of the shape #represents the width

Using Python.
 Using Python. Write a Class for Shape that Has the following

Write a Class for Shape that Has the following attributes: . height o width #represents the height of the shape #represents the width of the shape e Has the following methods: show-dimensions #prints out the height and width of the shape o to-string #returns a string description of the shape Write a Class for a Triangle that is a subClass of Shape (inherits from Shape) Has the following attributes in addition to those from Shape: o style #like right or isosceles Has the following methods: . get-area # returns the area of the triangle (1/2width" height) to-string #returns a string description of the shape o Write a Class for a Rectangle that is a subClass of Shape (inherits from Shape) . Has the following attributes: o style #like rectangle or square . Has the following methods: get-area #returns the area of a rectangle (widthheight) o get-perimeter #returns the perimeter (2"(width + height) o to-string #returns a string description of the shape Write a short program that . Instantiates at least 1 triangle and 1 rectangle . exercses each method for each triangle and rectangle created

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!