Programming languages ii - Modularity and scope Flashcards
Difference between function and procedure?
A function returns a value while a procedure does not.
Modularity
Degree of relatively independent components (modules).
Module
Part of a program.
Can contain one/several subroutines, functions or procedures.
Library
Pre-compiled subroutines incorporable into a program.
Global variable
Variable accessed within the whole duration of the program.
Local Variable
Defined & can only be used within one part of the program.
Scope
Section of code which variable can be used & has a value.
Function
Block of code within a program
Unique identifiable name,
zero or more parameters
returns single value
Procedure
Block of code within a program
Unique identifiable name,
zero or more parameters when called
Argument
Data provided to function / procedure when called
Pre-conditions
A condition that always must be true just prior to the execution of some section of code.