Skip to content

Parameters and Return ValuesActivities & Teaching Strategies

Active learning works for parameters and return values because students must physically pass data into functions and handle outputs to see why modular design matters. When learners test functions in real code, they immediately grasp the difference between arguments and parameters, and why returns promote reusability over printing.

Grade 10Computer Science4 activities20 min35 min

Learning Objectives

  1. 1Design functions that accept multiple parameters to solve a given computational problem.
  2. 2Compare the output of functions when different arguments are passed to the same parameters.
  3. 3Evaluate the impact of using return values versus modifying global variables on code readability and maintainability.
  4. 4Analyze the flow of data into and out of functions to predict program behavior.

Want a complete lesson plan with these objectives? Generate a Mission

25 min·Pairs

Pair Programming: Parameter Practice

Pairs define three functions: one taking two numbers as parameters to return their product, one processing a list to return its sum, and one calculating average from multiple args. They write test calls with varied arguments and check outputs. Extend by chaining functions.

Prepare & details

Differentiate between arguments and parameters in function calls.

Facilitation Tip: During Pair Programming: Parameter Practice, circulate and ask each pair to verbalize how the argument values map to the parameter names before running the code.

Setup: Groups at tables with access to research materials

Materials: Problem scenario document, KWL chart or inquiry framework, Resource library, Solution presentation template

AnalyzeEvaluateCreateDecision-MakingSelf-ManagementRelationship Skills
35 min·Small Groups

Small Groups: Function Chain Challenge

Groups receive starter code with global variables. They refactor into functions using parameters and returns, like a score processor that takes player data and returns rankings. Test chains where one function's output feeds another's input. Share successes.

Prepare & details

Design functions that accept multiple inputs and return meaningful outputs.

Facilitation Tip: During Function Chain Challenge, provide scaffolded examples first, then step back to let groups discover how return values enable chaining.

Setup: Groups at tables with access to research materials

Materials: Problem scenario document, KWL chart or inquiry framework, Resource library, Solution presentation template

AnalyzeEvaluateCreateDecision-MakingSelf-ManagementRelationship Skills
20 min·Whole Class

Whole Class: Trace and Debug Relay

Project code with functions on the board. Class traces step-by-step as teacher calls functions with arguments, revealing parameter binding and returns. Students predict outputs in chat, then debug errors collectively.

Prepare & details

Evaluate the benefits of using return values over modifying global variables within functions.

Facilitation Tip: During Trace and Debug Relay, assign each student a small role in the trace so everyone contributes to the final output.

Setup: Groups at tables with access to research materials

Materials: Problem scenario document, KWL chart or inquiry framework, Resource library, Solution presentation template

AnalyzeEvaluateCreateDecision-MakingSelf-ManagementRelationship Skills
30 min·Individual

Individual: Refactor Assignment

Students get code relying on globals. Individually rewrite using parameters and returns, test with five cases, and document benefits. Submit for peer review next class.

Prepare & details

Differentiate between arguments and parameters in function calls.

Facilitation Tip: During Refactor Assignment, require students to submit both the original and refactored versions to highlight the clarity gains from clean returns.

Setup: Groups at tables with access to research materials

Materials: Problem scenario document, KWL chart or inquiry framework, Resource library, Solution presentation template

AnalyzeEvaluateCreateDecision-MakingSelf-ManagementRelationship Skills

Teaching This Topic

Start with concrete examples using familiar calculations, like distance between points, so students see parameters as inputs they control. Avoid abstract lectures on scope; instead, use live coding where you intentionally make mistakes with global variables and let students spot the risks. Research shows that students master returns faster when they experience the frustration of hard-to-debug globals in their own code.

What to Expect

By the end of these activities, students will confidently define functions with multiple parameters, call them with correct arguments, and use return values to chain operations without side effects. They will also debug functions by tracing parameter flow and justify when to return versus modify globals.

These activities are a starting point. A full mission is the experience.

  • Complete facilitation script with teacher dialogue
  • Printable student materials, ready for class
  • Differentiation strategies for every learner
Generate a Mission

Watch Out for These Misconceptions

Common MisconceptionDuring Pair Programming: Parameter Practice, watch for students confusing arguments and parameters.

What to Teach Instead

Have pairs annotate their code with arrows from the call’s arguments to the definition’s parameters and label each side clearly before running the function.

Common MisconceptionDuring Function Chain Challenge, watch for students defaulting to printing results inside functions.

What to Teach Instead

Require groups to submit two versions of their code: one that prints inside the function and one that returns, then have them test how each integrates with the next function in the chain.

Common MisconceptionDuring Trace and Debug Relay, watch for students assuming return values automatically update global variables.

What to Teach Instead

In the relay, include a step where students must manually assign the return value to a variable and explain why globals are unnecessary in that scenario.

Assessment Ideas

Quick Check

After Pair Programming: Parameter Practice, display a function definition and call on the board. Ask students to write down the parameters and arguments, then predict the return value before running it to check their answers.

Exit Ticket

After Function Chain Challenge, have students submit a one-paragraph reflection on how return values made their function chain easier to debug compared to using globals or printing.

Discussion Prompt

During Trace and Debug Relay, pause the activity and ask: 'Could this function work if it modified a global variable instead of returning a value? Why or why not?' Use their responses to transition into Refactor Assignment.

Extensions & Scaffolding

  • Challenge students who finish early to design a function that accepts a list of coordinates and returns the perimeter of the polygon they form.
  • For students who struggle, provide a partially completed function with blanks for parameters and a call example, asking them to fill in the missing parts.
  • Deeper exploration: Ask students to compare the performance and readability of a function that returns a value versus one that prints, then present findings to the class.

Key Vocabulary

ParameterA variable listed inside the parentheses in a function definition. It acts as a placeholder for a value that will be passed into the function.
ArgumentThe actual value that is sent to a function when it is called. This value is assigned to the corresponding parameter.
Return ValueThe value that a function sends back to the part of the program that called it. This is specified using the 'return' keyword.
Function CallAn instruction that executes the code within a defined function. It can include arguments that are passed to the function's parameters.

Ready to teach Parameters and Return Values?

Generate a full mission with everything you need

Generate a Mission