Question: Need help with this in python, please: Design two classes, Airport and its specialized subclass GeoAirport, for the organization of airport information. Airport instances will

Need help with this in python, please: Design two classes, Airport and its specialized subclass GeoAirport, for the organization of airport information. Airport instances will encompass fundamental data such as IATA codes, names, and locations. On the other hand, GeoAirport instances will provide additional features by incorporating geographic coordinates and a compilation of nearby airports within a 150km range. The GeoAirport class will include a method named nearby_airports() to generate a well-formatted string displaying the nearby airports.
The program will process input in six different formats utilizing command-line arguments captured in sys.argv:
* Execute the script with an IATA code as an argument.
* Execute the script with latitude and longitude in MS format.
* Execute the script with latitude and longitude in MS format, and specify the number of nearest airports.
* Execute the script with latitude and longitude in decimal format.
* Execute the script with latitude and longitude in decimal format, and specify the number of nearest airports.
* Execute the script with a substring of the airport name.
The script will retrieve airport data from files named "airports" and "airport-coordinates". In cases where no matching format is identified, it will resort to substring matching within airport names.
Few Examples:
Command: python ais.py SFO, would output: SFO San Francisco International Airport (San Francisco, California, United States; 37\deg 3708N 122\deg 2236W)
Airports near: 7km HAF Half Moon Bay Airport (Eddie Andreini Sr. Airfield)
Airports near: 19km OAK Oakland International Airport
Airports near: 21km SQL San Carlos Airport
Airports near: 25km HWD Hayward Executive Airport
Airports near: 26km SJC Norman Y. Mineta San Jose International Airport
Another example, for command: python ais.py 37.7749-122.4194, output would be:
6km SFO San Francisco International Airport (San Francisco, California, United States)
18km OAK Oakland International Airport (Oakland, California, United States)
30km SJC Norman Y. Mineta San Jose International Airport (San Jose, California, United States)
60km SMF Sacramento International Airport (Sacramento, California, United States)
68km MRY Monterey Regional Airport (Monterey, California, United States)

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!