Control Structures Flashcards

1
Q

Name the 5 Control Structures

A
  1. Sequence
  2. Binary Selection
  3. Casewhere
  4. Pre Test Loop
  5. Post Test Loop
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is Sequence?

A

Sequence is one event after another

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

What is Repetition?

A

There are 2 types of Repetition: - Pre Test Loop

- Post Test Loop

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

What is the Syntax for a Pre-test loop

A

WHILE (Test Condition) is TRUE
DO (Process1)
ENDWHILE

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

What is the Syntax for a Post-test loop

A

(Statement Before Loop)
REPEAT (Process)
UNTIL (Test Condition) is TRUE
(Statement after loop)

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

What is the Pseudocode for Sequence

A

BEGIN
(Process1)
(Process2)
END

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

What is the Pseudocode for Binary Selection

A
IF (Test Condition)  = TRUE THEN
DO (Process1)
ELSE
DO (Process2)
ENDIF
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the Pseudocode for Casewhere?

A
CASEWHERE (Expression E.g. Cereal, Book, Movie)
         -Choice1: (Process1)
         -Choice2: (Process2)
          -Otherwise: (Default Process)
END CASE
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is Repetition used for?

A

Used to loop a number of steps until some condition is satisfied

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