lajdlksadlmla
[rmh3093.git] / lab1 / Activity3 / TestPoint.java
bloba9a605aae5b19fc3b5eeb710760ad20af43407d4
1 /*
2 * TestPoint.java
4 * Version:
5 * $Id: TestPoint.java,v 1.7 2008/03/13 19:30:23 rmh3093 Exp $
7 * Revisions:
8 * $Log: TestPoint.java,v $
9 * Revision 1.7 2008/03/13 19:30:23 rmh3093
10 * add test case for getDistance()
12 * Revision 1.6 2008/03/13 19:10:56 rmh3093
13 * fix brokenness
15 * Revision 1.5 2006/12/08 18:46:59 vcss232
16 * fixed log
17 * .,
21 /**
22 * This class tests the Point class. There are errors in
23 * this program!!
25 * @author Paul Tymann
28 public class TestPoint {
29 private static Point p1, p2;
31 public static void main( String args[] ) {
33 // Create a point to play with and verify the X and Y coordinates
35 p1 = new Point( 2, 3 );
36 System.out.println( "x = " + p1.getX() );
37 System.out.println( "y = " + p1.getY() );
39 // Create a second point and then use setPoint() to initialize
40 // the X and Y coordinates of the second point.
42 p2 = new Point();
43 p2.setPoint( 4, 5 );
44 System.out.println( "x = " + p2.getX() );
45 System.out.println( "y = " + p2.getY() );
47 // Try out move
49 p2.move( 6, 7 );
50 System.out.println( "x = " + p2.getX() );
51 System.out.println( "y = " + p2.getY() );
53 // Try out distance
54 System.out.println( "d = " + p2.getDistance(p1) );
57 } // TestPoint