This is Exercise 8.3, ManhattanDistance, on page 567 of your textbook.
This is Exercise 8.3, ManhattanDistance, on page 567 of your textbook.Add the following accessor method to
the Point class:
public int manhattanDistance( Point other )
Returns the “Manhattan distance” between the current Point object and the given other point object. The Manhattan distance refers to the distance between two places if one can travel only vertically or horizontally, as though driving on the streets of Manhattan. In our case, the Manhattan distance is the sum of the absolute values of the differences in their coordinates; in other words, the difference in x plus the difference in y between the points.
Be sure to include a separate PointMain.java file containing the main() method which demonstrates your manhattanDistance() method as well as the Point.java file containing the manhattanDistance() method definition. Zip up both files as PointManhattan.zip and submit the zip file through Canvas.
Help me plz.
Looking for a Similar Assignment? Order now and Get 10% Discount! Use Coupon Code "Newclient"
