-
Notifications
You must be signed in to change notification settings - Fork 0
/
Point.java
44 lines (37 loc) · 843 Bytes
/
Point.java
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
public class Point{
private double x,y;
public String toString(){
return "(" + x + ", " + y + ")";
}
//Initialize this Point to have the same values as the other Point.
public Point(Point other){
//COMPLETE THIS SECOND
//Then write test cases.
x = other.getX();
y = other.getY();
}
//Initialize this Point to have the provided values
public Point(double x, double y){
this.x=x;
this.y=y;
}
public double getX(){
return x;
}
public double getY(){
return y;
}
/*
Write this method FOURTH, go to the main and do that one first.
*/
public double distanceTo(Point other){
return 0.0;
}
/*
Write this method last. Re-use (NOT COPY/PASTE) prior work and
do not write redundant code.
*/
public static double distance(Point a, Point b){
return 0.0;
}
}