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
Get step-by-step solutions from verified subject matter experts
Document Format (2 attachments)
636825f616869_240837.pdf
180 KBs PDF File
636825f616869_240837.docx
120 KBs Word File
