| Lesson Plan |
| Grade: |
Date: 05/03/2026 |
| Subject: Computer Science |
| Lesson Topic: Declare and use variables and constants |
Learning Objective/s:
- Describe the purpose and benefits of using variables and constants in programs.
- Apply correct naming conventions and rules when creating identifiers.
- Declare, assign, and re‑assign variables in both static and dynamic languages.
- Define and use constants appropriately.
- Test and debug simple programs to ensure variables hold expected values.
|
Materials Needed:
- Projector or interactive whiteboard
- Computer lab with IDE (e.g., Python, Java)
- Printed handout of naming rules and data types
- Sample code worksheets
- Whiteboard markers
- Exit ticket cards
|
Introduction:
Begin with a quick poll: “What would happen if we hard‑code every number in a program?” Connect to prior learning on data types and ask students to predict challenges. Explain that today’s success criteria are to correctly name, declare, and use both variables and constants in a short program.
|
Lesson Structure:
- Do‑now (5'): Quick quiz on data types and previous variable use.
- Mini‑lecture (10'): Why use variables? Review naming rules with slides and examples.
- Guided practice (15'): Demonstrate declaring variables and constants in Python and Java; students replicate on their computers.
- Pair activity (15'): Complete a worksheet to write pseudocode for a grade calculator, identifying variables and constants.
- Common mistakes discussion (5'): Review checklist of typical errors and correct them as a class.
- Exit ticket (5'): Each student writes one naming rule and one constant example.
|
Conclusion:
Summarise how proper naming, declaration, and use of constants improve code readability and reliability. Collect exit tickets to gauge understanding, and assign homework to create a short program that uses at least three variables and one constant.
|