-
Book Overview & Buying
-
Table Of Contents
The C++ Programmer's Mindset
By :
We’ve already identified one small problem that we will have to solve before we can write our file readers: extracting the location data from the free-form text sightings. This might not always be possible – for instance, the coordinates might not be present in the text at all.
One problem that needs a good discussion is how we format the results to be returned to the client. The only instruction given here is that it should print the results to the terminal, and, as we’ve already mentioned, we can infer that they might want to take this as input to another program. Thus, a sensible strategy here is to return a simple table of latitude and longitude, illustrated here.
51.5074 -0.1278
19.432608 -99.133209
19.076090 72.877426
(The first coordinate here is London, which we have already seen. The latter are Mexico City and Mumbai, which are surprisingly close in latitude!) There are some other options...