Lab 10
Lab 10
Lab 10
Topic(s): Inheritance
IMPORTANT INSTRUCTIONS:
Please keep in mind the following points while coding. Violating any of these will result in
credit deduction.
Question No. 01
Question No. 02
Create two classes:
BaseClass
The Rectangle class should have two data fields-width and height of int types. The class
should have display()method, to print the width and height of the rectangle separated
by space.
DerivedClass
The RectangleArea class is derived from Rectangle class, i.e., it is the sub-class of
Rectangle class. The class should have read_input() method, to read the values of width
and height of the rectangle. The RectangleArea class should also override the display()
method to print the area (width*height) of the rectangle.
Question No. 03