define iteration
a sequence of instructions is repeated multiple times
examples of iteration
difference between do…until and while loops
define selection
changing the flow of the program
selection commands in LMC
BRA
BRZ
BRP
define IDE
Integrated Development Environment - software which enables you to enter, edit, compile (or interpret) and run your programs. many IDEs have debugging facilities to help you find the logic errors in a program
features of IDEs for code writing
features of IDEs for debugging
define identifier
name that points to the memory location
define assignment
assigning a value to a memory location
define variable
a named location in memory where data can be stored and that can be changed throughout the program
define constant
cannot be the target of an assignment as you have to change the source code and then recompile. reduce the risk of errors by reducing access to the memory location
define subroutine
a set of instructions with a name that when called changes the sequence of a program
difference between procedures and functions
define parameters
appear in subroutine definitions and remain the same
define arguments
may change because they appear in subroutine calls
passing by reference(value)
the address of the argument calling the statement is passed to the corresponding parameter in the subroutine. any calculation performed on that parameter in the subroutine will change the value of the corresponding argument in the calling routine
define global variables
defined in the main program and can be re-used in subroutines
advantages of local variables
define modular programming
advantages of modular programming
programs are more quickly and easily written:
- large programs are broken down into subtasks that are easier to program and manage
- each module is individually tested
- modules can be re-used several times in a program
- large programs are much easier to debug and maintain
characteristics of recursion routines
use of call stack