Sander Hoovenaar wrote:If I understand you correctly, my style is not really appropriate. How could I improve it? Could I have written the while-loop more concise...
That's a mechanical solution, when I suspect that what you really need to do is think about this problem as a whole a bit more.
For example: What about a
Position or
MapReference class that
includes latitude and longitude, and "knows" how to calculate the distance between two of its own objects?
That'll remove a lot of "noise" from your existing class, and you've already basically written the method.
Winston