Write a Rectangle class in Python language
that includes the following: [0.5 POINT]
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]
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 × H, where S is the length*width
and H is the height. [1 POINT]
Create an object of type Parallelepiped with
three arguments entered from the user and then print its volume on
screen. [1 POINT]
Write a Rectangle class in Python language that includes the following: [0.5 POINT] An initializer/constructor method
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am