Study your flashcards anywhere!

Download the official Cram app for free >

  • Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off

How to study your flashcards.

Right/Left arrow keys: Navigate between flashcards.right arrow keyleft arrow key

Up/Down arrow keys: Flip the card between the front and back.down keyup key

H key: Show hint (3rd side).h key

A key: Read text to speech.a key


Play button


Play button




Click to flip

29 Cards in this Set

  • Front
  • Back
A ______ ______ describes the interface to a subprogram as well as the actions of the subprogram.
subprogram definition
A ______ ______ is an explicit request that a subprogram be executed.
subprogram call
A subprogram is _____ if it has been called but has not yet returned.
A ______ ______, the first line of a definition, serves several purposes:
- Indicates (often by a special word) the beginning of a subprogram definition, and may indicate whether the subprogram is a procedure or a function.
- Provides a name for the subprogram.
- May optionally specify a list of parameters.
subprogram header
Function declarations are called _____ in C and C++. Such declarations are
often placed in header files.
The ______ ______ of a subprogram is the number, order, and types of its formal parameters.
parameter profile
The ______ of a subprogram is its parameter profile plus, if it is a function, its
return type.
Parameters in a subprogram header are called ______ ______.
formal parameters
A subprogram call specifies the name of the subprogram and a list of _____ ______ to be bound to the subprogram’s formal parameters.
actual parameters
In nearly all languages, the correspondence between actual and formal parameters
is done by position: The first actual parameter is bound to the first formal
parameter and so forth. Such parameters are called ______ ______.
positional parameters
One solution to this problem of long argument lists is to provide _______ _______, in which names of formal parameters are explicitly connected with actual parameters.
keyword parameters
Subprograms can define their own variables, called ______ ______.
local variables
The idea of nesting subprograms originated with ______ and direct
descendants, including _____, _____, and ______.
Algol 60

Algol 68, Pascal, and Ada
The C-based languages do not support nesting subprograms, but some newer languages do, including _____, ______, and ______.
JavaScript, Python, and Ruby
_______ methods are ways in which parameters are transmitted to and/or from called subprograms.
______ is a combination of pass-by-value and pass-by-result. It is an implementation model for inout-mode parameters in which actual values are
Pass-by-value-result is sometimes called ______ because the actual parameter is copied to the formal parameter at subprogram entry and then copied back at subprogram termination.
_____, _____ and ____ modes are for inout-mode parameters.
Pass-by-value-result, Pass-by-reference, Pass-by-name
______ is an inout-mode parameter transmission method that does not correspond to a single implementation model.
C++ allows reference parameters to be declared const. What does this do?
pass-by-reference but cannot be changed within the function.

Example declaration:
void fun(const int& p1, int p2, int& p3) { … }
Python and Ruby support ______, in which each actual parameter (a reference to an object) is assigned to the corresponding formal parameter. An actual parameter cannot be changed within a subprogram, but the object to which it refers can modified.
______, ______, ______, and ______ allow the programmer to overload operators.
Ada, C++, Python, and Ruby
A ______ is a special kind of subprogram. Unlike conventional subprograms,
coroutines behave more like equals.
Since control is often transferred to a coroutine at a point other than its beginning,
the invocation of a coroutine is called a _____, not a call.
______ was the first high-level programming language to support coroutines.

Additionally, Other languages that support coroutines include BLISS, INTERLISP, and
A coroutine may execute partially and then transfer control to another coroutine.
When restarted, a coroutine resumes execution just after the statement it used to
transfer control elsewhere. This sort of interleaved execution sequence is sometimes
called _____.
The environment of the statement that calls the passed subprogram.
shallow binding
The environment in which the passed subprogram.
deep binding
The environment of the call that passed the subprogram as an actual parameter.
ad hoc binding