Day 3 - Expressions and Operators

Day 3: Expressions and Operators

Learning Objectives

Essential Questions

Materials Needed

Vocabulary

Procedure (50 minutes)

Opening (8 minutes)

  1. Review and Connection (3 minutes)

    • Review variables and assignments from previous lesson
    • Connect to today's focus on expressions and operators
  2. Warm-up Activity (5 minutes)

    • Display several arithmetic expressions and ask students to evaluate them
    • Discuss how order of operations applies in programming

Main Activities (32 minutes)

  1. Lecture: Arithmetic, Relational, and Logical Operators (12 minutes)

    • Define expressions as combinations of values, variables, operators, and procedure calls
    • Explain that expressions are evaluated to produce a single value
    • Introduce arithmetic operators:
      • Addition (+)
      • Subtraction (-)
      • Multiplication (*)
      • Division (/)
      • Modulus (MOD)
    • Demonstrate how each operator works with examples
    • Explain order of operations and precedence rules
    • Briefly introduce relational operators (=, ≠, >, <, ≥, ≤) and logical operators (AND, OR, NOT)
    • Show how operators can be combined in complex expressions
  2. Demo: Order of Operations in Expressions (8 minutes)

    • Walk through the step-by-step evaluation of complex expressions
    • Show how parentheses can be used to control evaluation order
    • Demonstrate common mistakes in expression writing
    • Show how the same expression can be written in different ways
    • Compare mathematical notation with programming notation
  3. Hands-on: Writing and Evaluating Expressions (12 minutes)

    • Students work in the programming environment
    • Guide students through writing expressions with different operators
    • Have students predict the result of expressions before running them
    • Include exercises with variables in expressions
    • Challenge students to write expressions for specific scenarios (e.g., converting temperatures, calculating averages)

Closing (10 minutes)

  1. Activity: Debugging Expressions with Syntax Errors (5 minutes)

    • Provide students with expressions containing common errors
    • Students identify and fix the errors
    • Discuss common mistakes and how to avoid them
    • Emphasize the importance of careful syntax in expressions
  2. Exit Ticket and Preview (5 minutes)

    • Students write and evaluate expressions with multiple operators
    • Preview that next class will focus on strings and string operations

Assessment

Differentiation

For Advanced Students

For Struggling Students

Homework/Extension

Teacher Notes