This task is similar to the previous task, but this time there are rivers to cross as well as roads.   Most of the program has been written for you, but it won’t compile because one of the function definitions is missing.

Tasks:

We will have to write the function 'void crossRiver()'.   The function will look similar to the function crossRoad() which is already programmed for you, but the name will be different and the instructions for the function will be the same as the previous river crossing task.

We will have to take care where we put the function definition:

The compiler won’t let us put a function definition inside another function definition.
The compiler will give an error if we put the function definition after a corresponding function call, because as it works from the top of the text to the bottom it won’t know about the definition when it’s compiling the call.
The compiler will give an error if we put the function definition before an import statement.

Tasks: