1/10
Looks like no tags are added yet.
What is a subroutine?
Named section of code that can be called by writing the subroutines name jn a program statement
What is a procedure?
Set of instructions that will be executed when the procedure is called
What is a function?
Contains a set of instructions that will be executed but returns a value when its finished executing
What is a local variable?
A variable which is only accessible within a specific part of the program. They are local to a subroutine and can only be called within it.
What is a global variable?
Variable which can be accessed anywhere in the program and they can be updated in any part of the program.
What is modularity?
The process of breaking a large provlem jnto smaller separate sections called modules
Why is modularity useful?
It is easier to understand since each module has a specific purpose
Its easier to test since you can test each module separately
It is easier ti debug since errors are easier to locate within it
It is easier to maintain since you can change ine module without affecting the whole program
Difference between a procedure and function?
Procedure does not return a value whereas function does.
What is passing by value?
The subroutine gets a copy of the data
What is passing by reference?
Giving the function direct access to the original data