- In investigate tasks you are given some example code.
- Underneath it are questions to make sure that you understand how the code works.
- Use comments to answer the investigate questions on the example code.
The key idea here is that when we use functions our code will no longer run in line order, instead it will jump from the main program to each function called and back again.
Help! My code doesn’t work
Make sure that you check for the following things:
- The subroutine name is identical everywhere it is used (capitals matter)
- The function call is not indented inside the function
- The function is defined before it has been called