Lesson Plan

Lesson Plan
Grade: Date: 17/01/2026
Subject: Information Technology IT
Lesson Topic: Apply JavaScript loops (for, while, do-while)
Learning Objective/s:
  • Describe the purpose and syntax of for, while, and do‑while loops in JavaScript.
  • Apply each loop type to solve simple programming problems.
  • Identify and correct common loop errors such as infinite loops and off‑by‑one mistakes.
  • Use break and continue statements appropriately within loops.
Materials Needed:
  • Projector or interactive whiteboard
  • Student laptops with a JavaScript‑enabled IDE or browser console
  • Printed handout of loop syntax tables
  • Sample code snippets (digital)
  • Whiteboard markers
Introduction:

Start with a quick poll: “How many times have you needed to repeat an action in a program?” to capture interest. Review prior knowledge of variables and conditional statements. Explain that by the end of the lesson students will be able to write, run, and debug for, while, and do‑while loops.

Lesson Structure:
  1. Do‑Now (5') – short quiz on loop concepts.
  2. Mini‑lecture (10') – present syntax table and compare loop types with live examples.
  3. Guided coding demo (15') – code a for counter, a while sum, and a do‑while menu, pausing for questions.
  4. Pair programming activity (20') – rewrite a given for loop as a while loop and create a do‑while password checker; teacher circulates.
  5. Debugging challenge (10') – groups find and fix an infinite loop and an off‑by‑one error from prepared snippets.
  6. Exit ticket (5') – each student writes one correct loop syntax and one common pitfall to avoid.
Conclusion:

Recap the three loop structures and when each is most appropriate. Collect exit tickets and address any remaining misconceptions. Homework: complete the four exercise questions in the worksheet and submit code screenshots.