Subprograms Flashcards
Subroutines are the
Fundamental building blocks of programs
Where can subroutines be defined?
Within programs or separately in libraries
What are some other names for a subroutine are (4)
Procedure, routine, method or subprogram
During the execution of a subroutine the caller is
Suspended
Where is the control returned to when a subroutine execution terminates
To the caller
Parameters/formal params are the
Expected values
Actual pamareter/arguments are the
Actual values provided by the calling program
What are the two types of actual/formal parameters
Positional and keyword parameters
Position parameters the binding is done
By the position
Keywords parameters, what are stored together
Formal parameters and corresponding actual parameters
What are the advantages of network parameters
Order is irrelevant
Don’t worry about wrongly ordered parameters
Disadvantages keyword parameters
Users must know and specify the names of formal parameters
What are the two parameters passing methods
Semantic models and implementation models
What are the three distinct semantic models that formal parameters are characterized by?
In mode, out mode, and inout mode
What is inmode?
They can receive data from the corresponding actual parameters
What is out mode?
They can transmit data to the actual parameters
Inout mode
Inmode and out mode