Lesson Plan

Lesson Plan
Grade: Date: 17/01/2026
Subject: Computer Science
Lesson Topic: Understand the purpose of storing data in a file
Learning Objective/s:
  • Describe why data persistence is needed beyond program execution.
  • Explain the advantages and disadvantages of using files for data storage.
  • Identify appropriate file types (text vs. binary) for different data needs.
  • Demonstrate how to open, write to, and close a file using pseudocode.
  • Apply best practices for file security and error handling.
Materials Needed:
  • Projector and screen
  • Whiteboard and markers
  • Student worksheets with file‑I/O examples
  • Computers with an IDE (e.g., Python or Java)
  • Sample text file (e.g., scores.txt)
  • Handout of pseudocode checklist
Introduction:

Begin by asking students how they would keep a game score after the program ends. Review prior knowledge of variables and RAM as temporary storage. Explain that today’s success criteria are to articulate why files are used and to write basic file‑I/O pseudocode.

Lesson Structure:
  1. Do‑now (5') – Quick quiz on the difference between memory and permanent storage.
  2. Mini‑lecture (10') – Purpose of storing data, key advantages/disadvantages, and file types.
  3. Guided demonstration (15') – Live coding: open, write, and close a text file in the IDE.
  4. Pair activity (15') – Students write pseudocode to record student names and scores, then swap to review.
  5. Check for understanding (5') – Exit‑ticket question: “When would you choose a binary file over a text file?”
Conclusion:

Recap the reasons for using files, the basic file‑I/O steps, and security considerations. Collect exit tickets and assign homework: modify the pseudocode to read the saved scores and display them on screen.