Question: Write in python 1a)Today we will work with shapes. A general shape will have a particular color and area. We can divide a shape into
Write in python
1a)Today we will work with shapes. A general shape will have a particular color and area. We can divide a shape into circles, triangles and quadrilaterals. Circles have center points and radius. Triangles have three edges. Quadrilaterals have four edges. Further, we can divide quadrilaterals into parallelograms, non-parallelograms and trapeziums. A square, rhombus and rectangle are also parallelograms. Now create an inheritance tree from the above example. 1b) Suppose we have an abstract class of Pet and two other classes Dog and Cat inherits it. Now give a suitable example of abstract class and abstract methods using these three classes. Demonstrate why using abstract classes and abstract methods are important here.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
