Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a set of classes of Shapes (triangle, quadrilateral, circle) with the following inheritance relationship. Shapes.jpg Declare and define the classes as Shapes-- Abstract base

Create a set of classes of Shapes (triangle, quadrilateral, circle) with the following inheritance relationship. Shapes.jpg Declare and define the classes as Shapes-- Abstract base class. Triangle -- Abstract derived class with base class as Shapes IsoscelesTriangle -- derived class with base class as Triangle.(Attribute with two sides) EquilateralTriangle -- derived class with base class as Triangle(Attribute with one side) Quadrilateral --Abstract derived class with base class as Shapes. Rectangle -- derived class with base class as Quadrilateral.(Attribute with two sides-- length and breadth) Square -- derived class with base class as Quadrilateral.(Attribute with one side) Rhombus -- derived class with base class as Quadrilateral. (Attribute with two sides-- length and breadth) Circle -- Derived class with base class as Shapes. (Attribute with radius) Display a Menu Interface to the user to Create an instance of the Object. The Menu should be like. Create an Instance of Triangle Create IsoscelesTriangle Create EquilateralTriangle Quadrilateral Create Rectangle Create Square Create Rhombus Create Circle Create should create an instance of the derived class selected and then call the getData() function of that class and store that instance in the array of Shapes(Base Class). You can add constructors for the derived classes with default values. Write a test main function to take the input from the user for all the shapes and store them in a array, then print the area and perimeter of the class. Refer: http://www.math.com/tables/geometry/index.htm All the measurements is in Centimeters

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

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

More Books

Students also viewed these Databases questions

Question

LO6 List the components of job descriptions.

Answered: 1 week ago

Question

LO3 Define job design and identify common approaches to job design.

Answered: 1 week ago