Write a Rectangle class in Python language that includes the following: [0.5 POINT] An initializer/constructor method

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Write a Rectangle class in Python language that includes the following: [0.5 POINT] An initializer/constructor method

Post by answerhappygod »

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]
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply