7. Programming Constructs Flashcards

1
Q

What is Sequence?

A

Sequence is when the lines of code are run one line at a time and the lines are run in the order they were written in.

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

What is Branching (Selection)?

A

Branching is when the flow of the program is interrupted and a condition is tested.
The outcome of the condition will determine which lines or block of code is to run next

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

Tow ways to write Selection statements?

A

If, elseif and else statements: this is when you test conditions sequentially.

switch & case statements: this is when you test an expression against multiple possible constant values known as cases.

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

What is iteration?

A

Iteration is repeating a line or a block of code using a loop

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

What are the two types of iteration?

A

Count controlled: this is when the code is repeated a fixed number of times (using for loop)

Condition controlled: this is when the code is repeated and until a condition is met ( using a while loop or a do wire loop)

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