Unit 11 - Programming Techniques Flashcards
define iteration
a sequence of instructions is repeated multiple times
examples of iteration
- for loop
- do…until
- while
difference between do…until and while loops
- while loop condition is tested at the start
- do..until condition is tested at the end. therefore code is always run at least once
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
- line numbers
- automatically indent code
- auto-complete commands
- comment or un-comment a region
features of IDEs for debugging
- set a breakpoint in the program which will cause the program to stop on that line
- set a watch on a variable so that its value is displayed each time it changes
- step through a program one line at a time
- trace the execution of the program
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
- a function returns a value
- call statement differs
define parameters
appear in subroutine definitions and remain the same