| Lesson Plan |
| Grade: |
Date: 03/03/2026 |
| Subject: Computer Science |
| Lesson Topic: Explain where in the construction of an algorithm it would be appropriate to use a procedure |
Learning Objective/s:
- Describe why procedures are used and the advantages they provide in algorithm design.
- Identify the stages of algorithm construction where a procedure should be introduced.
- Write pseudocode that includes clear procedure calls and specifications.
- Apply unit‑testing techniques to a procedure before integrating it into the main algorithm.
- Evaluate how procedures improve code reuse, readability, and debugging.
|
Materials Needed:
- Projector and screen
- Whiteboard and markers
- Student worksheets with sample algorithms
- Laptops or computers with a simple IDE/text editor
- Printed handout of the “determineGrade” example
- Sticky notes for quick exit tickets
|
Introduction:
Begin by asking students to recall a time they wrote the same line of code more than once. Connect this to their existing knowledge of pseudocode and loops, and explain that today they will learn a systematic way to avoid such duplication. Outline that by the end of the lesson they will be able to spot where a procedure belongs, write it, and test it independently.
|
Lesson Structure:
- Do‑Now (5'): Quick quiz on identifying duplicated code in a short algorithm.
- Mini‑lecture (10'): Explain the purpose of procedures, benefits, and typical situations for their use.
- Guided analysis (15'): Work through the “determineGrade” example, highlighting the repeated grading logic and deciding where to insert a procedure.
- Pseudocode drafting (15'): Students rewrite the main algorithm, replacing the repeated section with a CALL statement and drafting a procedure skeleton.
- Procedure specification (10'): Define inputs, outputs, and internal steps for the new procedure; record it in a separate pseudocode block.
- Testing activity (10'): Perform unit‑testing on the procedure using sample marks, then integrate and run a full‑algorithm test.
- Whole‑class review (5'): Share solutions, discuss common errors, and reinforce the checklist for introducing procedures.
|
Conclusion:
Summarise how procedures help organise algorithms, improve readability, and simplify testing. Ask each student to write on a sticky note one benefit of using a procedure and the stage of algorithm design where they would first introduce it as an exit ticket. For homework, students will extend the grading algorithm by adding a separate procedure for input validation.
|