Supplied list traces
The list, condition, initial value and update each affect the trace
- Position Use one-based indexing in this stated pseudocode model
- Visit Process each occurrence in list order, including repeats
- Update Distinguish adding one from adding the entry value
- Initial value Set it before the loop and retain it when no iteration runs
Common mistakes
Difficulty levels
Questions about this topic
Does a failed condition remove an entry?+
No, the entry was visited; the running total simply stays unchanged for that visit
Must an empty loop output zero?+
No, it retains the stated initial result unless another instruction changes it
Can I use a calculator?+
No. This topic is practised without a calculator
Which year level and chapter is this?+
Year 7 Digital Technologies, chapter 4: Algorithms