Point Example Requirements Specification



1)     Create a class called Point that represents a point in two-dimensional space. You should include the following members in your design:

  • an instance constant that wil be the name of the instance.


  • instance variables to hold the values of the coordinates.


  • accessor and mutator instance methods to access and change the values of the coordinate variables.


  • a constructor that just takes in the name.


  • a constructor that takes in the name and initial coordinate values.


  • a constructor that takes in the name, and another Point instance from which to copy the coordinate values.


  • the toString method, overridden from the Object class.


  • a public class method that takes in two Point instances, and return the decimal value euclidean distance between the instances, based on their coordinate values.


  • 2)     In addition to the requirements listed above, add any methods or data that you need in order to conserve the Object-Oriented and data abstraction approach. Follow all style guides, all commenting guides, and produce javadoc web pages when finished.

    3)     Then write a class to start a program running and test the Point class on a couple of instance objects. Verify that the results of the output are correct for you test program.