Question: Details TASK Class Hierarchy: Define a base class called Shape with attributes name and color. This class should have a method display _ info (

Details
TASK
Class Hierarchy:
Define a base class called Shape with attributes name and color. This class should have a method display_info() that prints the name and color of the shape.
The base class should also have a method area() and perimeter () without implementation. You can use the pass keyword for this.
Implement three subclasses: circle, Rectangle, and Triangle, each inheriting from the Shape class.
Functionality:
Each subclass should have additional attributes and implement the methods and perineter () to calculate and return the area and perimeter according to its geometric properties.
Write a simple program that creates instances of each shape class by providing necessary parameters (e.g., radius, length, width).
Display the information of each created shape using the mod.
Calculate and display the area and perimeter for each created shape using the methods.
Look up the formulas for the area and perimeter on the Internet.
 Details TASK Class Hierarchy: Define a base class called Shape with

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!