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 wont compile because one of the function definitions is missing.
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 wont 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 wont know about the definition when its compiling the call. |
| The compiler will give an error if we put the function definition before an import statement. |
Add the missing function definition to the program. A reasonable place to put it is just before the void main function
Run the program. Note the order in which instructions are performed