Question: Plz follow the instruction (In JAVA ) Problem 2. (Comparable Geo Location) Implement an immutable data type Location in Location.java that representsa location on Earth
Plz follow the instruction (In JAVA


)
Problem 2. (Comparable Geo Location) Implement an immutable data type Location in Location.java that representsa location on Earth and supports the following API method Location(String loc, double lat, double lon) double distanceTo (Location that) boolean equals (Location that) description construct a new location given its name, latitude, and longitude values the great-circle distance between this location and that is this location the same as that? -1, 0, or 1 depending on whether the distance of this location to the origin is less than, equal to, or greater than the distance of that location to the origin, where the origin is the center of the universe, ie, UMass Boston (42.3134, -71.0384) a string representation of the location, in "loc (lat, lon)" format int compareTo (Location that) String toString() t See Problem 4 of Homework 1 for formula $ java Location 5 40.6769 117.2319 Chichen Itza (Mexico) (20.6829, -88.5686) Christ the Redeemer (Brazil) (22.9519, -43.2106) Machu Picchu (Peru) (-13.1633, -72.5456) The Colosseum (Italy) (41.8902, 12.4923) Petra (Jordan) (30.3286, 35.4419) The Great Wall of China (China) (40.6769, 117.2319) Taj Mahal (India) (27.175, 78.0419) true
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
