Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Database Systems Design Implementation And Management

Authors: Peter Rob, Carlos Coronel

6th International Edition

061921323X, 978-0619213237

More Books

Students also viewed these Databases questions

Question

Use Thevenins Theorem to Find Vo in the circuit shown 12V 1

Answered: 1 week ago