Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Document Format ( 2 attachments)

PDF file Icon
636825f616869_240837.pdf

180 KBs PDF File

Word file Icon
636825f616869_240837.docx

120 KBs Word File

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Calculus

Authors: Dale Varberg, Edwin J. Purcell, Steven E. Rigdon

9th edition

131429248, 978-0131429246

More Books

Students also viewed these Programming questions