Procedures, functions, parameters and structured control flow allow programs to be decomposed. Scope defines where names are visible; pass-by-value and reference-like behaviour affect which changes reach the caller.
Learning objectives
Explain programming and software development using a concrete example.
Apply the worked method and justify each step.
Recognise the limitation described in the final check.
The big idea
Procedures, functions, parameters and structured control flow allow programs to be decomposed. Scope defines where names are visible; pass-by-value and reference-like behaviour affect which changes reach the caller.
Requirements, design, implementation, testing and maintenance form a development process. Choose tests from specifications and risks, not only examples that the implementation already handles.
Worked example
A function returns n×n. What is returned for n=5?
Follow the solution
Substitute 5 into the defined expression: 5×5=25.
Investigate and explain
Predict the worked result before calculating. Change one input, record the new result, and explain which assumptions still hold.
Use the prediction activity below; a local model appears only where it supports this topic.