Quick Index
Overview


This challenge will follow the "Example" closely.

We will be extending our "Point.java" from our previous challenges.
And we'll also be adding to our "PointTests.java" to keep the tests up.

Copy Code


Copy "Point.java" and "PointTests.java" from your previous work into a new working directory.

Extend Point Class


Add the following constructors to the "Point" class:
ConstructorDescription
Add a "no-arg constructor"Set both ivars to zero
Add a constructor with one method parameterSet both ivars to the one method parameter
Add a constructor with two method parametersSet the "x" and "y" ivars to the first and second method parameters respectively


Extend PointTests Class


Add these three test methods to PointTests:


You can code these similar to how it is done in RectangleTests in the "Example", except of course, you will be testing Point objects, not Rectangle objects.

Make sure your tests show "actual" vs "expected" so we can see the result of the test -- similar to this example.

NOTE WELL -- Make sure you have the methods getX, getY, setX setY, and the two "set" methods in your Point class (from previous work).

Make sure you call the test methods from your "main" method in PointTests.

Grading


For this assignment, we will use these grading rules.

Note that for this challenge the submitted JAVA file should compile without errors as usual, and PointTests should run properly.