Question: Create one base class, several abstract subclasses, and several concrete subclasses. Create the following: 1. A superclass (base class): i. A class called Shape 1.

Create one base class, several abstract subclasses, and several concrete subclasses. Create the following: 1. A superclass (base class): i. A class called Shape 1. It contains the an attribute called color 2. It contains the following methods: a. Constructor b. Methods called for printing c. Get and set methods for the attribute(s), if applicable 2. Several abstract subclasses: i. A class called TwoDShape that inherits from Shape 1. It contains the following methods: a. Constructor b. Methods called for printing c. Get and set methods for the attribute(s), if applicable d. get_area() and get_perimeter() calculation methods ii. A class called ThreeDShape that inherits from Shape 1. It contains the following methods: a. Constructor b. Methods called for printing c. Get and set methods for the attribute(s), if applicable d. get_volume() calculation method 3. Several concrete subclasses: i. 3 classes of your choosing that inherit from TwoDShape 1. Each class should contain its appropriate attributes 2. Each class should implement all necessary methods to make it a concrete class. Also implement __init__ and __str__. ii. 3 classes of your choosing that inherit from ThreeDShape 1. Each class should contain the appropriate attributes 2. Each class should implement all necessary methods to make it a concrete class. Also implement __init__ and __str__. 4. A main function, that contains code to: i. Constructs 6 objects one object for each of your 6 concrete subclasses ii. Calls print() on each object

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!