Distance and Bearing: Difference between revisions

Line 90:
</pre>
=={{header|Java}}==
'''Author'''
Implementation:
[[User:Sjharper79|Sjharper79]] ([[User talk:Sjharper79|talk]])
'''Description'''
 
This java program contains two classes. One class holds the airport information, and the other class does all of the work to perform calculations and print results. Some of the logic adapted from ''J''.
 
 
'''Implementation:'''
<syntaxhighlight lang=Java>// The Airport class holds each airport object
package distanceAndBearing;
Line 219 ⟶ 227:
}
</syntaxhighlight>
'''Usage'''
<syntaxhighlight lang=java>
import distanceAndBearing.DistanceAndBearing;
public class MyClass {
 
public static void main(String[] args) {
DistanceAndBearing dandb = new DistanceAndBearing();
dandb.readFile("airports.txt");
dandb.findClosestAirports(51.514669,2.198581);
}
}
</syntaxhighlight>
'''Output when lat = 51.514669 and lon = 2.198581'''
<pre>
Num Airport Country ICAO Distance Bearing
25

edits