Computational logic Flashcards
What is a sequence?
A sequence is the order in which programming constructs are executed
What is selection?
Sometimes you only want some lines of code to be run only if a condition is met, otherwise you want the computer to ignore these lines and jump over them. This is achieved using IF statements.
e.g. If a condition is met then lines 4, 5, 6 are executed otherwise the computer jumps to line 7 without even looking at line 4,5 and 6.
What is iteration?
Sometimes you want the computer to execute the same lines of code several times. This is done using a loop. There are three types of loops: For loops, while loops and repeat until loops. That’s handy as it enables you not to have to copy the same lines of code many times.
<
Less than
>
Greater than
!=
Not equal to
==
Equal to
<=
Less than or equal
> =
Greater than or equal
What is base 2?
The two states on(1) and off(0)
1+1
10
1+0
0
0+0
0
1+1+1
11
1+1+1+1
100