AP CSP Day 3 - Expressions and Operators
AP CSP Day 3 - Expressions and Operators
Course Information
- Course: AP Computer Science Principles
- Unit: Big Idea 1 - Creative Development (CRD)
- Lesson: Day 3 (50 minutes)
- Learning Objective: CRD-1.C - Use expressions and operators appropriately
Learning Objectives
Primary Goals
Students will be able to:
- Define what an expression is
- Understand how operators work in expressions
- Create and evaluate expressions in programs
- Perform operations using different types of operators
AP Exam Alignment
- Big Idea 1: Creative Development (10-13% of AP Exam)
- Essential Knowledge: CRD-1.C.1, CRD-1.C.2, CRD-1.C.3
- Computational Thinking Practice: 1.A - Investigate the situation, context, or task
Lesson Structure (50 minutes)
Opening Hook (10 minutes)
1.1 Welcome & Lesson Preview (5 minutes)
Teacher Activities:
- Recap previous day's content on variables
- Introduce today's topic on expressions and operators
Student Activities:
- Think about: "What are some examples where we use expressions in daily life?"
1.2 Expression Examples Challenge (5 minutes)
Activity: "Identify the Expression"
Instructions:
- Groups of 4-6 students
- Identify expressions in given scenarios
- Discuss the importance of expressions
Purpose: Activate thinking about expressions
Core Content Instruction (20 minutes)
2.1 What are Expressions? (10 minutes)
Definition (CRD-1.C.1):
An expression is a combination of values, variables, operators, and function calls that produces a result.
Key Concepts:
- Arithmetic operators: +, -, *, /, %
- Comparison operators: ==, !=, <, >, <=, >=
- Logical operators: and, or, not
Case Study: Using expressions in a simple program
- Program: Calculate the average of three numbers
- Expressions: sum = num1 + num2 + num3; average = sum / 3
2.2 Types of Operators (5 minutes)
Examples:
- Arithmetic: x + y, x * y
- Comparison: x > y, x == y
- Logical: x and y, not x
Discussion Questions:
- What makes a good expression?
- Can you think of an example where expressions are used in daily life?
- Why are expressions important in programming?
2.3 Operator Precedence (5 minutes)
Why is it important?:
- Precedence rules: Order of operations
- Parentheses: Changing precedence
Discussion Questions:
- How can we control the order of operations?
- Why is operator precedence important in programming?
Hands-On Activity (15 minutes)
3.1 Group Project: Create a Program with Expressions (15 minutes)
Activity: "Design a Program"
Instructions:
- Groups of 3-4 students
- Design a program that uses expressions
- Present the program to the class
Materials:
- **Program design worksheet
- **Expression usage checklist
Learning Goals:
- **Define an expression
- **Use expressions in a program
- **Perform operations
- **Present ideas effectively
Assessment:
- **Group participation
- **Program quality
- **Presentation clarity
Closure & Preview (5 minutes)
4.1 Key Concepts Review (2 minutes)
Today's Learning Highlights:
- ✅ Understanding what an expression is
- ✅ Identifying examples of expressions
- ✅ Creating and evaluating expressions in programs
- ✅ Performing operations using different types of operators
AP Exam Connection:
- These concepts will appear in AP exam multiple choice questions
- Understanding expressions is crucial for the Create Performance Task
4.2 Next Class Preview (3 minutes)
Day 4 Topic: "Strings and String Operations"
- Learning Objective: CRD-1.D - Use strings and string operations appropriately
- Activity: Practicing string manipulation
- Homework: Think about a recent program you used. What expressions did it employ?