Question: / C + + pls; #ifndef RECTANGLE 2 D _ H #define RECTANGLE 2 D _ H class Rectangle 2 D { public: Rectangle 2
C pls;
#ifndef RECTANGLEDH
#define RECTANGLEDH
class RectangleD
public:
RectangleD;
RectangleDdouble x double y double width, double height;
double getX const;
double getY const;
double getWidth const;
double getHeight const;
The rest in Exercise are not used in this exercise. They can be omitted
private:
double x y; Center of the rectangle
double width, height;
;
#endif
RectangleD::RectangleD
x y ;
width height ;
RectangleD::RectangleDdouble x double y double width, double height
thisx x;
thisy y;
thiswidth width;
thisheight height;
double RectangleD::getX const
return x;
double RectangleD::getY const
return y;
double RectangleD::getWidth const
return width;
double RectangleD::getHeight const
return height;
MyRectangleD getRectangleconst double pointsSIZE int numberOfPoints;
const int SIZE ;
double minXconst double pointsSIZE int numberOfPoints
Return the code to return the minimum ycoordinate in points
double maxXconst double pointsSIZE int numberOfPoints
Return the code to return the maximum xcoordinate in points
double minYconst double pointsSIZE int numberOfPoints
Return the code to return the minimum ycoordinate in points
double maxYconst double pointsSIZE int numberOfPoints
Return the code to return the maximum ycoordinate in points
RectangleD getRectanglePointerconst double pointsSIZE int numberOfPoints
Write your code to return a point to a RectangleD object that is the minimum bounding rectangle for the points
Hint: invoke minX, minY, maxX, and maxY to find the minimum x y and maximum x y for the bounding rectangle.
RectangleD getRectangleconst double pointsSIZE int numberOfPoints
Write your code to return a RectangleD object that is the minimum bounding rectangle for the points
Hint: invoke minX, minY, maxX, and maxY to find the minimum x y and maximum x y for the bounding rectangle.
#include
using namespace std;
int main
double points;
cout "Enter five points: ;
Write your code to read five points
RectangleD boundingRectangle getRectanglepoints;
cout "The bounding rectangle's center boundingRectangle.getX
boundingRectangle.getY width boundingRectangle.getWidth
height boundingRectangle.getHeight endl;
RectangleD boundingRectangleP getRectanglePointerpoints;
cout "The bounding rectangle's center boundingRectanglePgetX
boundingRectanglePgetY width boundingRectanglePgetWidth
height boundingRectanglePgetHeight endl;
return ;
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
