Creating Functions with Parameters Lesson Objectives • Write functions with parameters to generalize a solution instead of duplicating code. • Identify appropriate situations for creating a function with parameters. • Use random numbers as inputs to function calls for the purpose of testing. • Add parameters to a function in an existing piece of code to generalize its behavior. Creating Functions with Parameters Think-Pair-Share What is the benefit of using parameters in a function? • Makes your function more responsive to different scenarios • Your function is a general solution to many problems Creating Functions with Parameters Tasks for today: Unit 3 – Stage 8 GOAL: Define & call functions with pa Bubble 2: Find the error in the code Bubble 3: Define drawTriangle(lengthOfSide) Bubble 4: Multiple Parameters Draw two squares Bubble 5: Define functions with multiple parameters Draw triangles Bubble 6-12: Incremented project – Under the Sea Scene Creating Functions with Parameters Assignments for this lesson • 3-8: Bubbles 13 & 14 • Summarize the lesson • Vocab: none
© Copyright 2025 Paperzz