Design a class Parallelogram that contains two private data members:
- double length,
- double height.
Parallelogram class should also have following public methods:
- parameterized constructor,
- a method to calculate area of parallelogram.
Design another class Rectangle that inherits from Parallelogram (since a Rectangle is-a Parallelogram). Class Rectangle should have the following public members:
- 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.
Note:
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here