Class Point- Point.h, Point.cc



 
Definition:
A point is a class which holds an x and y location on a Cartesian plane.
Typedefs:
None
Included:
#include <iostream.h>


Variable Index

o int x
The x location of the point on a Cartesian plane.
o int y
The y location of the point on a Cartesian plane.

Constructor Index

o Point()
Default constructor.
o Point(int xVal, int yVal)
Sets the values x and y to the respective passes values, xVal and yVal.
o ~Point()
Destructor.  Does absolutely nothing.


Method Index
 

o void setX(int xValue)
Sets the x variable to the value specified by 'xValue'.
o void setY(int yValue)
Sets the y variable to the value specified by 'xValue'.
o void getX()
Returns the value of the x variable.
o void getY()
Returns the value of the y variable.
o int getManhattanDistance(Point *aPoint)
Returns the Manhattan distance from this point to the point specified by 'aPoint'.
o void print()
Debugging function.  Prints the information contained by this instance to cout.