Distance and Bearing: Difference between revisions
Content added Content deleted
Sjharper79 (talk | contribs) |
Sjharper79 (talk | contribs) |
||
Line 148: | Line 148: | ||
airport.setLon(Double.valueOf(parts[7])); |
airport.setLon(Double.valueOf(parts[7])); |
||
this.airports.add(airport); |
this.airports.add(airport); |
||
System.out.println(airport); |
|||
} |
} |
||
fileScanner.close(); |
fileScanner.close(); |
||
Line 210: | Line 209: | ||
// Print the results. |
// Print the results. |
||
System.out. |
System.out.printf("%-4s %-40s %-25s %-6s %12s %15s\n", "Num", "Airport", "Country", "ICAO", "Distance", "Bearing"); |
||
System.out.println("-------------------------------------------------------------------------------------"); |
System.out.println("-----------------------------------------------------------------------------------------------------------"); |
||
int i = 0; |
int i = 0; |
||
for (Airport a : closestAirports) { |
for (Airport a : closestAirports) { |
||
System.out. |
System.out.printf("%-4s %-40s %-25s %-6s %12.2f %15.2f\n", ++i, a.getAirportName(), a.getCountry(), a.getIcao(), distanceMap.get(a.getAirportName()), headingMap.get(a.getAirportName())); |
||
+ distanceMap.get(a.getAirportName()) + "\t" + headingMap.get(a.getAirportName())); |
|||
} |
} |
||
return closestAirports; |
return closestAirports; |
||
Line 221: | Line 219: | ||
} |
} |
||
</syntaxhighlight> |
</syntaxhighlight> |
||
<pre> |
|||
Num Airport Country ICAO Distance Bearing |
|||
----------------------------------------------------------------------------------------------------------- |
|||
1 Koksijde Air Base Belgium EBFN 56.78 146.03 |
|||
2 Ostend-Bruges International Airport Belgium EBOS 57.93 127.05 |
|||
3 Kent International Airport United Kingdom EGMH 62.13 -107.64 |
|||
4 Calais-Dunkerque Airport France LFAC 63.74 -164.46 |
|||
5 Westkapelle heliport Belgium EBKW 78.85 105.32 |
|||
6 Lympne Airport United Kingdom EGMK 95.55 -119.92 |
|||
7 Ursel Air Base Belgium EBUL 97.82 114.41 |
|||
8 Southend Airport United Kingdom EGMC 104.13 -85.94 |
|||
9 Merville-Calonne Airport France LFQT 104.37 162.55 |
|||
10 Wevelgem Airport Belgium EBKT 104.58 137.48 |
|||
11 Midden-Zeeland Airport Netherlands EHMZ 106.05 89.55 |
|||
12 Lydd Airport United Kingdom EGMD 107.45 -124.82 |
|||
13 RAF Wattisham United Kingdom EGUW 109.23 -50.93 |
|||
14 Beccles Airport United Kingdom EGSM 109.81 -20.99 |
|||
15 Lille/Marcq-en-Baroeul Airport France LFQO 110.52 146.01 |
|||
16 Lashenden (Headcorn) Airfield United Kingdom EGKH 115.24 -109.59 |
|||
17 Le Touquet-Côte d'Opale Airport France LFAT 118.03 -159.74 |
|||
18 Rochester Airport United Kingdom EGTO 118.90 -98.09 |
|||
19 Lille-Lesquin Airport France LFQQ 122.67 149.24 |
|||
20 Thurrock Airfield United Kingdom EGMT 126.69 -88.13 |
|||
</pre> |
|||
=={{header|jq}}== |
=={{header|jq}}== |