Computer Science I / Functions and Parameter Passing
Practice question · Match the pairs

Match each term to its meaning.

  • Parameter
  • Argument
  • Return
  • Local variable
  • A name listed in the function's definition
  • Ends the function and hands a result back
  • The actual value passed in a call
  • Exists only during the call, invisible outside
Hints
  1. Two of these are about the inputs of a function; two are about what happens inside or on exit.
  2. One term names a value that vanishes the moment the function returns.
Show the answer
  • Parameter A name listed in the function's definition
  • Argument The actual value passed in a call
  • Return Ends the function and hands a result back
  • Local variable Exists only during the call, invisible outside
Why

Parameters are the definition's names, arguments are the call's values, return both ends the function and yields a result, and a local variable lives only for the duration of the call. Expecting to read a local from outside the function is the second pitfall this lesson names.

Read the lesson: Functions and Parameter Passing →

Practise Functions and Parameter Passing

The app has 5 more questions on this lesson, and keeps your place in the course. Computer Science I is free to start.

More questions on Functions and Parameter Passing