Question: Below you have the abstract class Shape with two private data members positionX and positionY of double type. Write the definitions of the member functions
Below you have the abstract class Shape with two private data members positionX and positionY of double type. Write the definitions of the member functions of class Shape and derived classes where required. Create a driver program following the given instructions. The program should print the values stored in private data members as well as the areas of particular objects where appropriate. Do not add more functions to any of the classes) Polymorphism ll Shape.h /l Contains the declaration (but not the definition!) of the Shape class. class Shape public Shape(double positionX, double positionY): virtual double getPositionXO: virtual double getPosition YO: virtual void move(double positionX, double positionY); virtual double get WidthO; virtual double getHeightO virtual void resize(double, double); virtual double area( ) = 0; virtual void print 0 private double positionX; double positionY; #endif// SHAPE H - I/ Shape.cpp / Contains the definitions of Shape's methods. #include "Shape-h" Shape: Shape(double positionX, double position Y) /l Use the "this>" notation
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
