Question: Use: GO LANG Implement ADT for coordinates on earth A coordinate is composed of a latitude, longitude pair. Make sure that the constructors are variadic,

Use: GO LANG
Implement ADT for coordinates on earth
A coordinate is composed of a latitude, longitude pair.
Make sure that the constructors are variadic, allowing for variable precision, for example: degrees and minutes; or degrees, degrees only, or degrees, minutes and seconds. (REQUIRE A COMPASS DIRECTION)
Latitude is an angular distance north or south from the Earth's equator measured from 0 degrees to 90 degrees. Each degree is divided into 60 minutes and each minute is divided into 60 seconds. For example, the latitude for the USA is 4043'50.1960'N which means the USA is 40 degrees, 43 minutes and 50 seconds of arc north of the equator.
Longitude is an angular distance east or west from the Earth's prime meridian measured from 0 degrees to 180 degrees. Each degree of longitude is divided into 60 minutes, and each minute is further divided into 60 seconds. For example, the longitude of the USA is 7356'6.8712'W, which means the USA is 73 degrees, 56 minutes and 6.8 seconds of arc west of the meridian.
The ADT should be able to input, output, compare and handle the coordinates in an appropriate manner.
Consider these errors:
Invalid Input Values:
When creating a new coordinate, validate input values such as degrees, minutes, and seconds. For example, latitude should be between -90 and +90 degrees, and longitude should be between -180 and +180 degrees.
Check if the provided direction is valid (example,"N" or "S" for latitude, "E" or "W" for longitude).
Coordinate Operations:
When performing operations that involve combining or modifying coordinates, check if the resulting values remain within the valid range (e.g., latitude between -90 and +90 degrees, longitude between -180 and +180 degrees).
Coordinate Reduction:
Include a Reduce() member function to reduce coordinates (normalizing minutes and seconds)l. Make sure that its resulting values are valid.
 Use: GO LANG Implement ADT for coordinates on earth A coordinate

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!