Lesson Plan

Lesson Plan
Grade: Date: 17/01/2026
Subject: Computer Science
Lesson Topic: Choose and design an appropriate user-defined data type for a given problem
Learning Objective/s:
  • Describe the benefits of using user‑defined data types in program design.
  • Identify the appropriate representation (record, enum, or class) for a given problem scenario.
  • Construct a user‑defined type with suitable attributes and operations using pseudo‑code.
  • Test the defined type with sample data to verify correct behaviour.
Materials Needed:
  • Projector and screen for slides.
  • Whiteboard and markers.
  • Handout outlining the design process and example code.
  • Computers with an IDE (e.g., Java or Python) for coding practice.
  • Printed UML diagram of the example Book type.
  • Worksheet with practice problem (exam‑result design).
Introduction:
Start with a quick discussion: how do we represent real‑world objects like a library book in code?
Students will recall primitive data types and why grouping related data is useful.
By the end of the lesson they will be able to choose the most suitable user‑defined type, design it, and produce working pseudo‑code.
Lesson Structure:
  1. Do‑now (5’) – Students list examples of real‑world entities that could be modelled with a single type. (Check understanding.)
  2. Mini‑lecture (10’) – Explain why user‑defined types are important, review records, enums, and classes, and present the systematic design steps.
  3. Guided example (15’) – Walk through the library‑book design, filling each step on the board and discussing representation choices.
  4. Pair activity (15’) – Students design a user‑defined type for a student exam result, complete the design steps on a worksheet, and write pseudo‑code.
  5. Class share & feedback (10’) – Pairs present their designs; teacher highlights correct attribute selection and appropriate type choice.
  6. Exit ticket (5’) – Students write one sentence describing how they decided on the representation for their design.
Conclusion:
Review the key steps: analyse the problem, select attributes, choose a representation, define the type, and test it.
Collect the exit tickets to gauge understanding.
For homework, students will implement their exam‑result type in their chosen programming language and submit a short test script.