Question: Here is the API for a Point class representing a 2-dimensional point. Code an application class (i.e., a class containing a main method), named PointApp


Here is the API for a Point class representing a 2-dimensional point. Code an application class (i.e., a class containing a main method), named PointApp that reads point data from the file points.text. This data is then used to create pairs of Point objects which are then used to flex (ie, illustrate) the methods of the class. The format of the points.text file is: x1 y1 x2 y 2 .e., pairs of x/y coordinates, resulting in data for 2 Point objects per line. The name of your class should be PointApp. For example, if the file points.text contains: 1 1 1 1 1 1 1 1 1 -1 -1 1 -1 -1 1 1 1 1 1 1 -2 -2 the program should produce the following output: p1: (0, 0) (quadrant O) / p2: (1, 1) (quadrant 1) p1+p2: (1, 1) (quadrant 1) The distance between (0,0) and (1, 1) is 1.4142135623730951 p1: (1, 1) (quadrant 1) / p2: (1, -1) (quadrant 4) p1+p2: (2, 0) (quadrant 4) p1 and p2 are reflections across the x-axis p1 and p2 are equidistant from the origin The distance between (1, 1) and (1, -1) is 2.0 p1: (1, 1) (quadrant 1) / p2: (-1, 1) (quadrant 2) p1+p2: (0, 2) (quadrant ) p1 and p2 are reflections across the y-axis p1 and p2 are equidistant from the origin The distance between (1, 1) and (-1, 1) is 2.0 p1: (1, 1) (quadrant 1) / p2: (-1, -1) (quadrant 3) p1+p2: (, 0) (quadrant O) p1 and p2 are reflections through the origin p1 and p2 are equidistant from the origin The distance between (1, 1) and (-1, -1) is 2.8284271247461903
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
