Computational logic Flashcards

1
Q

What is a sequence?

A

A sequence is the order in which programming constructs are executed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is selection?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is iteration?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

<

A

Less than

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

>

A

Greater than

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

!=

A

Not equal to

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

==

A

Equal to

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

<=

A

Less than or equal

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

> =

A

Greater than or equal

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is base 2?

A

The two states on(1) and off(0)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

1+1

A

10

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

1+0

A

0

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

0+0

A

0

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

1+1+1

A

11

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

1+1+1+1

A

100

How well did you know this?
1
Not at all
2
3
4
5
Perfectly