Implement a class GpxAnalyzer with a method calculate distance(gpx string: str) - float . You MUST use…
Implement a class GpxAnalyzer with a method calculate distance(gpx string: str) - float . You MUST use…: a task in r2e-code-instruct-qwen3.5 (Harbor dataset). Input: A valid GPX XML string. Output: Total distance in kilometers. Example: Input: <gpx version="1.1" <trk <trkseg <trkpt lat="40.0"…
The task
Input: A valid GPX XML string. Output: Total distance in kilometers. Example: Input: `<gpx version="1.1"><trk><trkseg><trkpt lat="40.0" lon="-75.0"></trkpt><trkpt lat="40.01" lon="-74.99"></trkpt></trkseg></trk></gpx>` Output: ~1.3 km Example: Input: `<garbage>` Output: Error raised
Part of Essacheez/r2e-code-instruct-qwen3.5.