Day 6 - Selection (Conditionals)

Day 6: Selection (Conditionals)

Learning Objectives

Essential Questions

Materials Needed

Vocabulary

Procedure (50 minutes)

Opening (8 minutes)

  1. Review and Connection (3 minutes)

    • Review algorithm design and testing from previous lesson
    • Connect to today's focus on making decisions in programs
  2. Warm-up Activity (5 minutes)

    • Present a real-world scenario that involves decision-making
    • Ask students to describe the decision process in their own words
    • Discuss how decisions can be represented as yes/no questions

Main Activities (32 minutes)

  1. Lecture: Selection Statements (12 minutes)

    • Define selection as a programming construct that executes different code based on conditions
    • Explain the structure and syntax of conditional statements:
      • IF (condition)
      • IF (condition) { statements } ELSE
    • Discuss Boolean expressions as conditions that evaluate to true or false
    • Explain how relational operators (=, ≠, >, <, ≥, ≤) are used in conditions
    • Show how the program flow changes based on condition evaluation
    • Demonstrate the execution of IF and IF-ELSE statements with examples
    • Explain the concept of blocks of statements in conditionals
    • Discuss common use cases for conditional statements
  2. Demo: Implementing Decision-Making in Code (8 minutes)

    • Walk through examples of programs that use conditionals:
      • Determining if a number is positive, negative, or zero
      • Checking if a user is eligible for a discount
      • Validating user input
      • Implementing game logic
    • Show how to trace the execution of conditionals step by step
    • Demonstrate how different inputs affect the program flow
    • Highlight common mistakes in conditional statements
  3. Hands-on: Writing Programs with Conditional Statements (12 minutes)

    • Students work in the programming environment
    • Guide students through creating programs that use conditionals
    • Have students implement programs for scenarios like:
      • Determining if a year is a leap year
      • Calculating grades based on scores
      • Implementing a simple calculator with different operations
      • Creating a simple game decision
    • Encourage students to test their conditionals with different inputs

Closing (10 minutes)

  1. Activity: Creating a Simple Decision-Making Program (5 minutes)

    • Students design and implement a program that makes decisions based on user input
    • The program should use both IF and IF-ELSE statements
    • Students should test their program with various inputs
    • Share and discuss different approaches
  2. Exit Ticket and Preview (5 minutes)

    • Students complete a program that uses conditional statements to solve a problem
    • Preview that next class will focus on Boolean logic and compound conditions

Assessment

Differentiation

For Advanced Students

For Struggling Students

Homework/Extension

Teacher Notes