Lesson Plan

Lesson Plan
Grade: Date: 17/01/2026
Subject: Computer Science
Lesson Topic: Understand and use nested selection and iteration statements
Learning Objective/s:
  • Describe the purpose of nested selection and iteration statements.
  • Explain how nested loops and selections interact to solve problems.
  • Apply nested selection and iteration to write pseudocode for tasks such as prime checking and multiplication tables.
  • Debug common errors, including infinite loops, in nested structures.
  • Evaluate algorithm efficiency when using nested constructs.
Materials Needed:
  • Projector and screen
  • Whiteboard and markers
  • Computer lab with IDE (e.g., VS Code)
  • Printed handouts of pseudocode examples
  • Worksheets with practice exercises
  • Access to an online coding platform (e.g., Replit)
Introduction:

Begin with a quick poll asking students which statements they use most often and why. Connect this to their prior work on simple if‑else and for‑loops, highlighting the need for more complex logic. State that today they will master nesting these constructs to tackle real‑world problems. Clarify that success will be demonstrated by correctly writing and debugging nested pseudocode.

Lesson Structure:
  1. Do‑Now (5'): Short quiz on selection vs. iteration concepts.
  2. Mini‑lecture (10'): Explain nested selection and iteration with a flowchart diagram.
  3. Guided demo (15'): Walk through the prime‑number pseudocode, emphasizing the outer loop and inner if.
  4. Pair programming (20'): Students write a nested loop to generate a 1‑10 multiplication table.
  5. Worksheet activity (10'): Write nested selection code to convert a numeric grade to a letter grade.
  6. Class discussion (5'): Identify and correct a deliberately faulty nested loop (infinite loop).
  7. Exit ticket (5'): Each student writes one tip for avoiding infinite loops in nested structures.
Conclusion:

Summarise how nesting expands the power of simple statements and review the key tip from the exit tickets. Remind students to practice writing clean, indented code to avoid logical errors. Assign homework: create a program that lists all prime numbers between 1 and 100 using nested loops and selections.