-
Notifications
You must be signed in to change notification settings - Fork 0
/
point.h
68 lines (59 loc) · 4.01 KB
/
point.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#ifndef _POINT_HEADER
#define _POINT_HEADER
class Point
{
private:
int x;
int y;
public:
//*********************************************************************************
//description: creates a new Point at the coordinates specified by the ints *
//returns: none *
//pre: none *
//post: a Point is created with x at the first int and y at the second *
//*********************************************************************************
Point(int, int);
//*********************************************************************************
//description: creates a default Point at (0,0) *
//returns: none *
//pre: none *
//post: a new Point is created with x and y = 0 *
//*********************************************************************************
Point();
//*********************************************************************************
//description: gets X *
//returns: int *
//pre: X exists and is a int *
//post: X remains unchanged *
//*********************************************************************************
int getX();
//*********************************************************************************
//description: gets Y *
//returns: int *
//pre: Y exists and is a int *
//post: Y remains unchanged *
//*********************************************************************************
int getY();
//*********************************************************************************
//description: sets X to the value of the int *
//returns: void *
//pre: X exists and is a int *
//post: the value of the int is stored in X *
//*********************************************************************************
void setX(int);
//*********************************************************************************
//description: sets Y to the value of the int *
//returns: void *
//pre: Y exists and is a int *
//post: the value of the int is stored in Y *
//*********************************************************************************
void setY(int);
//*********************************************************************************
//description: tests if two points are identical *
//returns: bool *
//pre: both points exist *
//post: true if the points match, false if they do not *
//*********************************************************************************
bool equals(Point p);
};
#endif