0% found this document useful (0 votes)
9 views1 page

Problem Statement

The document outlines a programming task to create a base class 'Shape' with a virtual function 'area()' that returns 0. It requires the implementation of two derived classes, 'Rectangle' and 'Circle', each with their own 'area()' methods to calculate their respective areas. The objective is to demonstrate polymorphism by invoking the correct 'area()' method at runtime based on the shape type.

Uploaded by

ziomlubda
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views1 page

Problem Statement

The document outlines a programming task to create a base class 'Shape' with a virtual function 'area()' that returns 0. It requires the implementation of two derived classes, 'Rectangle' and 'Circle', each with their own 'area()' methods to calculate their respective areas. The objective is to demonstrate polymorphism by invoking the correct 'area()' method at runtime based on the shape type.

Uploaded by

ziomlubda
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Problem Statement:

Create a base class Shape with a virtual function area() that returns 0.
Create two derived classes: Rectangle and Circle, each with their own area()
implementations that calculate the area of the respective shapes.
Objective:
 Implement overriding in classes that calculate areas for different
 shapes.
 Demonstrate polymorphism by calling the appropriate area()
 method at runtime.

You might also like