plotting x-y coordinates using java objects
Part 1: A point in the x-y plane is represented by its x-coordinate and y-coordinate.
Design the class Point that can store and process a point in the x-y plane.
Your class should contains the following methods.
• Default constructor without parameters that initializes the private data member to the suitable values
• Constructor with parameters—sets the values of the instance variables to the values of the parameter.
• Accessor methods that return the values of the x-axis and y-axis.
• setPoint method which set the values of x-axis and y-axis
• makeCopy method that make a copy of a received object of type Point.
• getCopy method that returns a copy of the current object
• toString method that returns the object string
• isEqual that returns true if the current object is equal to the received object of type point
• distance, which receives two objects of type Point and returns the distance between.
Part 1I:
Write a test program to test various operations on a point. For example, declare and create two objects of type Point. Each created object should include values read from the keyboard, for example object1(3, 5), object2(6,9). Display the value of each object. Test whether the two objects are equal. If they are not equal find and display the distance between the two objects. Create static method named distanceArray. The methods receive two parameters. The first one is a two dimensional array of type Point which has several rows and two columns. The second parameter is one dimensional array of type double that contains several rows equivalent to the number of rows of the two dimensional array. The methods calculates the distance between the two objects of each row and store it in the second array. Test this method by creating two dimensional array with several rows and two columns. Populate this array with values from the keyboard. Create an empty one dimensional array with number of rows equal to the number of rows of the two dimensional array. Call the method distance Array and then print the objects of the two dimensional array and the distance between the pair of the objects of each row.