Question: Create a class Geometry without any data member. Another class Circle is inherited from Geometry class which declares radius (of type float) as its data

Create a class Geometry without any data member.  Another class Circle is inherited from Geometry class which declares radius (of type float) as its data member. Derive another class Square from Geometry that declares side as its data member (of type int). By using the concept of polymorphism , display the area and perimeter of Circle and Square in main()

Area of Circle: PI*r2

Area of Square: r2

Perimeter of Square :4r

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Document Format (2 attachments)

PDF file Icon

636825f616869_240837.pdf

180 KBs PDF File

Word file Icon

636825f616869_240837.docx

120 KBs Word File

Students Have Also Explored These Related Programming Questions!