Chapter 9 Flashcards
a program module that contains a series of statements that carry out a task.
Method
contains the method’s implementation
method body
This contains identifying information about the method
Method header
Global is the opposite of
local scope / in scope
True or False: When a variable is declared locally within a method, its value cannot be used by other methods.
True
The calling program or method is the method’s…
client
The statements that carry out a task.
Implementation
A called method accepts the values it receives from the calling method; these accepted values are the called’s methods _________.
parameters
When a program passes a data item to a method, the data item is an __________ to the method
argument (to the method).
When writing the declaration for a method that can receive a parameter, you must provide a ________ ____.
parameter list
What are the two items that make up a parameter list?
- Parameter type
2. Local name for the parameter
The two elements of the parameter list, combined, make up the _______ _________.
method’s signature
A variable passed into a method is _______ ___ ______, which means that A COPY of its value is sent to the receiving method and stored in a new memory location accessible to that method.
passed by value
Because of the passed by value functionality, any value that aligns with the preordained _________ ____ can be passed to a method, even if this value is variable, a named constant, or an arithmetic expression, etc.
parameter type
True or False: When the method ends at the return statement, the locally declared parameter variables cease to exist.
True
The starting value of the main program occupies a different _______ _______ from the variable in the local program/module/method.
memory address
This gives back control to the calling method after a modular method executes.
method return statement
The arguments sent to a method in a method call
Actual parameters
The variables in the (receiving) method’s declaration
Formal parameters
When a method returns a value, the method must have a ______ ____ that matches the data type of the returned value.
return type
What is it called when a method returns nothing at all?
void method
This is listed in front of the method name when the method is defined.
Method’s (return) type