Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help in a C++ assignment. Please dont copy and paste others answers becuase i already tried and they were false. Aslo please describe

I need help in a C++ assignment. Please dont copy and paste others answers becuase i already tried and they were false. Aslo please describe ur codes in this assignment. Requested files: Point.h, Point.cpp, Shape.h, Shape.cpp, Polygon.h, Polygon.cpp, Ellipse.h, Ellipse.cpp, ShapeNodePoly.cpp, ShapeNodePoly_test.cpp

In this assignment, you will create a class that can behave as any of the shapes listed below. You will use object inheritance to enable all shapes to be managed using the same interface. The functions named in your interface file will be polymorphic; they behave differently depending on the instance of a shape is being emulated by an object.

Using the combination of inheritance and function overloading, you will design a program that can manipulate a group of objects derived from the base class Shape. A Shape is an abstract class that can be used to represent instances of the following geometric shapes:

A Triangle

A Rectangle

A Square

An Oval

A Circle

An Elliipse

Your program should contain classes to create each type of object listed above. You should design an inheritance hierarchy where all classes are derived from an abstract class called Shape. The shape class should have a virtual function getArea() that when invoked on an object will return the area of that shape object. You should insert the code from the GeometricArea program for the appropriate type of shape object. Here is a guide to calculating the area of an ellipse and how it relates to a circle.

Your program should make use of a concrete class named Point. Point has two fields of type float: x and y representing a Cartesian coordinate that identifies a location in the xy plane. Each shape should contain the necessary fields to represent itself: for example, a triangle would contain 3 Point objects, a circle 1 Point.

Be sure to consider using intermediate classes. For example, Triangle, Rectangle, Square are all polygons, so it is good design practice to create an intermediate class Polygon, from which Triangle, Rectangle and Square are all derived. There is a similar relationship between an ellipse and a circle; a circle is an ellipse where the two focal points are the same and the length of the major and minor radii are the same.

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

Beginning Databases With PostgreSQL From Novice To Professional

Authors: Richard Stones, Neil Matthew

2nd Edition

1590594789, 978-1590594780

More Books

Students also viewed these Databases questions

Question

u = 5 j , v = 6 i Find the angle between the vectors.

Answered: 1 week ago