2.2.1 Programming Techniques Flashcards
What is sequence?
When the lines of code are executed in order. The order of the lines of code is important as something can’t be called before it is referenced. e.g. a variable
What is selection?
Used to decide which section of code should be run depending on a conditional statement.
What operators can be used for comparison?
==
=!
<
>
>=
<=
What is iteration?
Repeating sections of code where the same lines of code can be executed multiple times.
What loops are involved in itteration?
FOR
WHILE
DO
What are FOR loops?
used for repeating sections of code for a known number of times - although this can be changed by using a variable - but the lines will only repeat for that number of times.
What are WHILE loops?
Conditional loops - the loop is only exeted when the condition is met.
What are DO loops?
Similar to a while loop but the condition is checked at the end of the section so that the code is always executed at least once.
DO x ….[CODE]…. UNTIL y
What is branching?
Jumping to other sections of code dependant on a condition. used within an if statement.
if x == y:
goto 2
What is a subroutine?
;ji;