Object-oriented programming groups state and behaviour; inheritance and polymorphism express relationships but need careful interfaces. Declarative styles describe desired results rather than every execution step.
Learning objectives
Explain programming paradigms, files and practical skills using a concrete example.
Apply the worked method and justify each step.
Recognise the limitation described in the final check.
The big idea
Object-oriented programming groups state and behaviour; inheritance and polymorphism express relationships but need careful interfaces. Declarative styles describe desired results rather than every execution step.
Practical programming combines data structures, file access, exception handling and systematic debugging. Use clear contracts and automated checks, protect private data and never execute untrusted input as code.
Worked example
A queue contains A then B. After removing one and adding C, what is its order?
Follow the solution
FIFO removes A, leaving B; C is appended after it.
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.