Question: D Requested files: Point.h , Point.cpp , Shape.h , Shape.cpp , Polygon.h , Polygon.cpp , Ellipse.h , Ellipse.cpp , ShapeNodePoly.cpp , ShapeNodePoly _ test.cpp (
D Requested files: Point.h Point.cpp Shape.h Shape.cpp Polygon.h Polygon.cpp Ellipse.h Ellipse.cpp ShapeNodePoly.cpp
ShapeNodePolytest.cpp boldsymboldownarrow Download
T Maximum number of files:
Type of work: boldsymbolTheta Individual work
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 Point objects, a circle 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.
HI CHEGG I WANT YOU TO GIVE ME A SEPARATE CODE FOR EACH REQUESTED FILE WHEN I TRY TO COMPILE ITS NOT COMPILING. Grade
Reviewed on Wednesday, November : PM by Automatic grade
Grade:
Assessment report $
VERIFIED: main in ShapeNodePolytest.cpp
Shape.cpp
Estimated content Points
Student Header
Source code comments
C required keywords
code content points
Error compiling your program
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
