Question: it is a java question, thank you very much!! Question 2 20 marks) Write a class named GeoCoordinate that retains the longitude and latitude of

 it is a java question, thank you very much!! Question 220 marks) Write a class named GeoCoordinate that retains the longitude and

it is a java question, thank you very much!!

Question 2 20 marks) Write a class named GeoCoordinate that retains the longitude and latitude of an object on earth. Both longi- tude and latitude are represented as double values that must be in the range [-90.0, 90.00. The class has the following constructors: GeoCoordinate0, which initializes the latitude to 0.0 (the equator, the longitude to 0.0 (the prime meridian) GeoCoordinate(double longitude, double latitude): initializes the longitude and latitudes to values in [-90.0, 90.0]. The class has the following methods double getLongitude() and double getLatitudeo, that return the longitude and latitude of the GeoCo- ordinate. boolean equals (GeoCoordinate g that returns true if the GeoCoordinate of g and the current object represent the same GeoCoordinate, and false otherwise. boolean isWithinBounds(GeoCoordinate sw, GeoCoordinate ne) that takes exactly two GeoCoor- dinates representing the south-west and north-est vertices of a rectangular area (see Figure below), and returns true if the current coordinate is within the bounds of the area, and false otherwise. This can be used to check whether a given vehicle for example has gone outside of a certain geographic area). ne SW

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!