Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I have to write a modified version of a Rectangle class that makes use of a Poin

ID: 3621661 • Letter: I

Question

I have to write a modified version of a Rectangle class that makes use of a Point class to keep track of its location in an x/y coordinate system.

Point
Private:
int x
int y
Public:
void setX(float v)
float getX()
void setY(float v)
float getY()

float distanceFromPoint(Point otherPoint)

Point()
Point(int xValue, int yValue)

The default constructor should set x and y to zero. The two argument constructor should initialize x and y with the argument values. Once the point class compiles I am supposed to be able write a Rectangle class that uses the point class, EG:
Rectangle
Private:
Point location
float width
float height
Public:
void setLocation(Point v)
Point getLocation()

void setHeight(float v)
float getHeight()
void setWidth(float v)
float getWidth()

Rectangle()
Rectangle(Point locationValue, float height, float width)
Rectangle(float xValue, float yValue, float height, float width)

bool containsPoint(Point value)
bool overlapsWithRectangle(Rectangle otherRectangle)

Finally a main function should be written that tests both classes, and at the end I should have five files.

• Rectangle.h
• Rectangle.cpp
• Point.h
• Point.cpp
• myProgram.cpp


It may seem a bit lengthy but any help in the right direction is much appreciated!

Explanation / Answer

Dear, Able to help you with some files Point.h class Point { //Member variables public :int X; int Y; //Member functions public: Point(){ X=0;Y=0;} Point(int x,int y) { X=x; Y=y; } void setX(int x); void setY(int Y); int getx() const; int gety() const; void printpoint()const; float distanceFromPoint(Point otherPoint); }; Point.cpp //Definitions of member functions void Point::setX(int x) { X=x; } void Point::setY(int y) { Y=y; } int Point::getx()const { return X; } int Point::gety()const { return Y; } void Point::printpoint()const { cout