QUESTION 1: (A) Write a Rectangle class in Python language that includes the following: [0.5 POINT] [7 POINTS] An initia
Posted: Mon Jun 06, 2022 1:53 pm
QUESTION 1: (A) Write a Rectangle class in Python language that includes the following: [0.5 POINT] [7 POINTS] An initializer/constructor method with parameters allowing you to build a rectangle with length and width attributes. [1 POINT] • A method named getArea() to calculate and return the area of the rectangle. [1 POINT] (B) Create a Parallelepiped class inheriting from the Rectangle class and includes the following: [1 POINT] • A constructor method with parameters to initialize height attribute and the other inherited attributes. [1.5 POINT] • A method named getVolume to calculate and return the volume of a parallelepiped object. The volume is calculated using the formula V = S x H, where S is the length*width and H is the height. [1 POINT] (C) Create an object of type Parallelepiped with three arguments entered from the user and then print its volume on screen. [1 POINT]