Please enable JavaScript to use CodeHS

AP Computer Science A (Mocha)

Lesson 3.3 Methods and Return Values

Description

Think of a method like assigning a task. A return value is giving you the completed work.
This allows you to write methods that do some work for you and send back the result.
Parameters are like inputs into the function, and the return value is output.


Objective

Students will be able to…

  • Explain the purpose of returning a value from a method.
  • Create methods that return values.
  • Create programs that call methods with return values and store the result for later use.