Boolean Expressions and Relational Operators Lesson Plan
Overview
In this lesson, students will learn how to use ternary conditional operator instead of if statements in programs.
Learning Objectives
- 1.2.A.1 Write and interpret Boolean expressions that use variables, constants, relational operators, and logic operators.
Skills
- S2.A Write program code and implement algorithms.
- S2.C Analyze an algorithm and program code for correctness.
Student Outcomes
Students will be able to:
- describe a boolean expression
- use relational operators to write boolean expressions
- determnine the value of a boolean expression
Duration: 1 class periods
Resources
Warm-up / Motivate
Think-Pair-Share:
- Think: Have students think about their favorite game and make a list of comparisons that are being made. Maybe it's comparing whether they have enough materials to build something new in a creating game or whetehr their score is the new high score. Give them 5 minutes to list as many comparisons they can think of.
- Pair: Have students pair up with someone that choose the same game or similar game. They should each share their list of comparisons and see if together they can think of any additional ones.
- Share: Select a couple of groups to share their list of comparisons.
Consider this question: How does the program make these comparisons?
Learn
Practice
You can have students submit the answers to the practice for a grade or review it as a group.
Wrap-up / Extension
Have students revisit the comparisons they wrote at the start of class. Have them create variables with sample values and write expressions to represent these comparisons.