Question: Design a class Parallelogram that contains two private data members: -double length, -double height. Parallelogram class should also have the following public methods: -parameterized constructor,
Design a class Parallelogram that contains two private data members:
- -double length,
- -double height.
- Parallelogram class should also have the following public methods:
- -parameterized constructor,
- -a method to calculate the area of the parallelogram.
- Design another class Rectangle that inherits from Parallelogram (since a Rectangle is-a Parallelogram). Class Rectangle should have following public members:
- -parameterized constructor,
- -a method to calculate perimeter,
- -a method to tell if the Rectangle object is a Square.
- Develop the main function to fully test these two classes.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
