In the control software for an autonomous deep-sea submersible, a local variable named densityOffset is declared within the subroutine calculatePressureDepth.
Explain what is meant by a local variable, referencing its scope and lifetime.
131 exam-style questions on AQA GCSE Computer Science Structured programming and subroutines (procedures and functions). Each one has a worked solution and a mark scheme showing where the marks go.