This lab test describes the implementation of the base class, Rectangle and Its derived class, Parallelogram. Create a p
Posted: Fri May 20, 2022 5:57 pm
This lab test describes the implementation of the base class, Rectangle and Its derived class, Parallelogram. Create a program that includes: a. Rectangle.h b. Rectangle.cpp C. Parallelogram.h d. Parallelogram.cpp e. MainProg.cpp - main program . i) Rectangle.h includes the declaration of class Rectangle that have the following: Attributes: Both height and width of type double. Behaviours: Constructor will initialise the value of height and width to 0. Destructor setData() set the value of height and width; given from user through parameters. . calcArea () - calculate and return the area of the Rectangle. • calcPerimeter() - calculate and return the perimeter of the Rectangle. 3 ii) Rectangle.cpp includes all the implementation of class Rectangle. iii) Parallelogram.h includes the declaration of class Parallelogram that will use the attributes and behaviours from class Rectangle. iv) Parallelogram.cpp includes the implementation of class Parallelogram. v) MainProg.cpp should accept height and width values and then show the area and the perimeter of the parallelogram shape.