Lesson Plan

Lesson Plan
Grade: Date: 17/01/2026
Subject: Computer Science
Lesson Topic: Understand and use nested statements
Learning Objective/s:
  • Describe what a nested statement is and why it is used in programming.
  • Explain the syntax and indentation (Python) or braces (Java) required for nested structures.
  • Apply nested if, while, and for statements to solve given problems.
  • Identify common pitfalls such as missing indentation, infinite loops, and excessive nesting.
  • Convert a nested logic block into an equivalent logical expression using and/or.
Materials Needed:
  • Projector and screen
  • Whiteboard and markers
  • Computer lab with Python IDE (e.g., IDLE) and Java IDE (e.g., Eclipse)
  • Printed worksheets with practice questions
  • Handout of flowchart diagram illustrating nested if logic
  • Sample code snippets (grading system, 2‑D array search)
Introduction:

Begin with a quick real‑world scenario (e.g., deciding whether to bring an umbrella based on weather forecasts) to highlight multi‑level decision making. Review students’ prior knowledge of simple if statements. Explain that by the end of the lesson they will be able to write, read, and debug nested control structures accurately.

Lesson Structure:
  1. Do‑now (5') – short quiz on basic if statements; collect responses as an exit ticket.
  2. Mini‑lecture (10') – definition of nesting, why it’s useful, syntax rules for Python indentation and Java braces; show flowchart diagram.
  3. Guided coding demo (15') – walk through the grading system example in Python, emphasising indentation levels.
  4. Pair programming (15') – students implement the 2‑D array search in Java, using nested for loops and break statements.
  5. Pitfalls discussion (10') – present common errors; learners identify and correct them in sample snippets.
  6. Independent practice (15') – worksheet with three practice questions (nested if, nested loops, logical conversion); teacher circulates for support.
  7. Review & exit ticket (5') – each student writes one rule for correct nesting on a sticky note.
Conclusion:

Recap the key points: purpose of nesting, proper syntax, and how to avoid typical mistakes. Collect the exit tickets to gauge understanding. For homework, assign students to design a small program that uses at least two levels of nesting to solve a real‑world problem (e.g., menu‑driven calculator).