Lesson Plan

Lesson Plan
Grade: Date: 17/01/2026
Subject: Computer Science
Lesson Topic: Use loops to process arrays
Learning Objective/s:
  • Describe the purpose of using loops to process arrays.
  • Explain how to implement for, while, and do‑while loops for array traversal.
  • Apply loops to calculate sum, average, maximum, count occurrences, and reverse an array.
  • Identify and correct common loop‑related errors such as off‑by‑one mistakes.
Materials Needed:
  • Projector or interactive whiteboard
  • Computer lab with IDE (Python/Java) installed
  • Printed handout of loop syntax and array examples
  • Sample array data sheets for practice
  • Whiteboard markers
  • Exit‑ticket slips
Introduction:
Begin with a quick visual of a line of students passing a ball to illustrate repeated actions. Ask students how they would add up a list of scores without writing each addition separately, linking to prior work on variables and basic loops. Explain that today they will learn to use loops to efficiently process arrays, and they will be able to write, test, and debug such code by the end of the lesson.
Lesson Structure:
  1. Do‑now (5'): Students complete a short quiz on loop syntax and array indexing on a worksheet. (Check understanding)
  2. Mini‑lecture (10'): Review array concepts and demonstrate a for‑loop that sums an array using the projector. (Show pseudocode)
  3. Guided practice (15'): In pairs, students write pseudocode to compute sum and average of a given array, then run it in the IDE. (Teacher circulates)
  4. Extension activity (10'): Students modify the code to find the maximum value and count occurrences, discussing off‑by‑one pitfalls. (Class discussion)
  5. Exam practice (10'): Individually attempt the provided exam question on finding the smallest value and its frequency. (Peer check)
  6. Summary & exit ticket (5'): Students write one thing they mastered and one question they still have on a slip. (Collect)
Conclusion:
Recap the key steps of using loops to traverse arrays and the common errors to watch for. Highlight how the practice tasks demonstrated real‑world applications such as calculating totals and finding minima. Collect exit tickets as a quick retrieval check and assign homework to write a program that reverses an array of ten numbers.