The Position class (in position.py of Package1). It should contain the methods required to perform the necessary actions, which includes: a. An __init__() method, which takes four arguments: latitude,...

The Position class (in position.py of Package1). It should contain the methods required to perform the necessary actions, which includes: a. An __init__() method, which takes four arguments: latitude, latitude cardinal direction string, longitude, and longitude cardinal direction string, then initializes the attributes latitude, longitude, and geometry. The latitude and longitude attributes designate latitude and longitude angle values of the position. You must determine if they are positive or negative, given the cardinal direction strings (i.e., S and W relate to negative latitude and longitude angles, respectively). The geometry attribute is a reference to an instance of a Geometry type or subtype object. b. A method (named “set_latitude”) that takes a floating-point number as a parameter and sets the attribute latitude. This method must make sure the latitude value is in the range [-90, 90] c. A method (named “get_latitude”) that takes no parameter and gets the value of latitude. d. A method (named “set_longitude”) that takes a floating-point number as a parameter and sets the attribute longitude. This method must make sure the longitude is in the range [-180, 180]. e. A method (named “get_longitude”) that takes no parameter and gets the value of longitude. f. A method (named “set_geometry”) that takes a Geometry based reference as a parameter and sets the attribute geometry. g. A method (named “get_geometry”) that takes no parameter and gets the value of geometry. h. A method (named “distance”) that takes a position as a parameter, delegates the calculation to the Geometry class, i.e., the curry_distance() method, and finally returns the value obtained from a curry_distance() call from the this position’s geometry.
Mar 10, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here