AP CSP Day 12 - Parameters and Return Values
AP CSP Day 12 - Parameters and Return Values
Course Information
- Course: AP Computer Science Principles
- Unit: Big Idea 1 - Creative Development (CRD)
- Lesson: Day 12 (50 minutes)
- Learning Objective: CRD-1.L - Use parameters and return values appropriately
Learning Objectives
Primary Goals
Students will be able to:
- Understand the concept of parameters and return values in functions
- Create programs using functions with parameters and return values
- Test and refine function logic involving parameters and return values
- Analyze real-world scenarios that require parameters and return values
AP Exam Alignment
- Big Idea 1: Creative Development (10-13% of AP Exam)
- Essential Knowledge: CRD-1.L.1, CRD-1.L.2, CRD-1.L.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 functions
- Introduce today's topic on parameters and return values
Student Activities:
- Think about: "What are some examples where we use parameters and return values in daily life?"
1.2 Parameter and Return Value Examples Challenge (5 minutes)
Activity: "Identify the Parameter and Return Value"
Instructions:
- Groups of 4-6 students
- Identify parameters and return values in given scenarios
- Discuss the importance of parameters and return values
Purpose: Activate thinking about parameters and return values
Core Content Instruction (20 minutes)
2.1 What are Parameters and Return Values? (10 minutes)
Definition (CRD-1.L.1):
Parameters allow data to be passed into a function, while return values allow data to be sent back from a function.
Key Concepts:
- Parameters: def function_name(param1, param2):
- Return values: return result
Case Study: Using parameters and return values in a simple program
- Program: Calculate the area of a rectangle
- Function structure: def calculate_area(length, width): return length * width
2.2 Types of Parameters (5 minutes)
Examples:
- Positional parameters: def function(a, b):
- Default parameters: def function(a=10):
- Keyword arguments: function(b=20, a=10)
Discussion Questions:
- What makes good parameter usage?
- Can you think of an example where parameters and return values are used in daily life?
- Why are parameters and return values important in programming?
2.3 Advanced Parameter Concepts (5 minutes)
Why is it important?:
- Flexibility: Handling different types of inputs
- Efficiency: Reducing unnecessary computations
Discussion Questions:
- How can we make functions flexible with parameters?
- Why is efficiency important when using parameters and return values?
Hands-On Activity (15 minutes)
3.1 Group Project: Create a Program with Parameters and Return Values (15 minutes)
Activity: "Design a Program"
Instructions:
- Groups of 3-4 students
- Design a program that uses functions with parameters and return values
- Test the program for correctness
- Present the program to the class
Materials:
- **Program design worksheet
- **Parameter and return value usage checklist
Learning Goals:
- **Understand parameters and return values
- **Create programs using functions with parameters and return values
- **Test function logic involving parameters and return values
- **Present ideas effectively
Assessment:
- **Group participation
- **Program quality
- **Testing thoroughness
- **Presentation clarity
Closure & Preview (5 minutes)
4.1 Key Concepts Review (2 minutes)
Today's Learning Highlights:
- ✅ Understanding the concept of parameters and return values in functions
- ✅ Creating programs using functions with parameters and return values
- ✅ Testing and refining function logic involving parameters and return values
- ✅ Analyzing real-world scenarios that require parameters and return values
AP Exam Connection:
- These concepts will appear in AP exam multiple choice questions
- Understanding parameters and return values is crucial for the Create Performance Task
4.2 Next Class Preview (3 minutes)
Day 13 Topic: "Function Design and Documentation"
- Learning Objective: CRD-1.M - Design and document functions appropriately
- Activity: Practicing function design and documentation
- Homework: Think about a recent program you used. What parameters and return values did it employ?