4.2. Distance Travelled - Java