I generally call methods that are defined inside a class as objectName.methodNam

    I generally call methods that are defined inside a class as objectName.methodName(argument-list);For the method for finding the distance between two points I might call this method distanceTo and I would likely call it like:pointA.distanceTo(pointB)where pointA and pointB are two points with the values of the instance variables known. This method would calculate and return a double (the distance between the two points) so the full call could be:double distance = pointA.distanceTo(pointB);I would then produce output that would be something like:The distance between (04) and (30) is 5.The method to find the slope of the line connecting two points would similarly be called:theSlope = pointA.slopeWith(pointB);Of course the slope of a line is undefined if the two points have the same x coordinate. To avoid a problem with this situation you do not have to worry about input of two points with the same x coordinate. Otherwise calculate and return the slop of the line. It would be beneficial to have a toString() method inside the class. A Any method called toString defined inside a class is expected to return a String. The toString method is designed to output information about any object of the class. The toString inside the Point class should return a String that would look like . Inside the second class the driver class ask the user to input from the keyboard the x and y coordinate of two points. Then call the two methods which compute the distance and the slope. Output the distance between the two points and the slope of the line connecting these points with information about what two points gave the distance and/or the slope.

                                                                                                                                      Order Now