| Lesson Plan |
| Grade: |
Date: 25/02/2026 |
| Subject: Computer Science |
| Lesson Topic: Show understanding of how Reverse Polish Notation (RPN) can be used to carry out the evaluation of expressions |
Learning Objective/s:
- Describe the difference between infix, prefix, and postfix (RPN) notation.
- Apply the Shunting‑Yard algorithm to convert infix expressions to postfix form.
- Evaluate a postfix expression using a stack and trace each operation.
- Write clear pseudocode for an RPN evaluator.
|
Materials Needed:
- Projector or interactive whiteboard
- Printed worksheets with infix expressions
- Index cards bearing operators and operands
- Laptops with a simple IDE or Python interpreter
- Whiteboard and markers
|
Introduction:
Begin with a quick demonstration of a classic HP calculator that evaluates expressions without parentheses, sparking curiosity about how it works. Review students’ prior knowledge of infix notation and operator precedence, then state that by the end of the lesson they will be able to convert and evaluate expressions using Reverse Polish Notation.
|
Lesson Structure:
- Do‑now (5') – Solve a simple infix expression on paper and discuss the need for parentheses.
- Direct instruction (10') – Explain RPN concept, show operator‑after‑operand format, compare with infix.
- Guided practice (15') – Walk through the Shunting‑Yard algorithm on the example (3+4)×5‑6÷2; students fill in a step‑by‑step table.
- Hands‑on activity (15') – In pairs, convert a set of infix expressions to RPN and evaluate them using a stack trace.
- Coding demo (10') – Display pseudocode and run a short Python script that evaluates a postfix expression, highlighting stack operations.
- Check for understanding (5') – Quick quiz (exit ticket) with one conversion and one evaluation question.
|
Conclusion:
Summarise how RPN eliminates parentheses by embedding precedence in token order and how a stack makes evaluation straightforward. Collect the exit tickets, then assign homework: each student creates their own infix expression, converts it to RPN, and evaluates it using the pseudocode learned today.
|