Topic 3: Understanding Structure Flashcards

1
Q

A logically snarled program statements

A

Spaghetti code

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

Known to be unstructured programs

A

Spaghetti code

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

A basic unit of programming logic

A

Structure

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

Three basic types of structures:

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

Directs the computer to process program instructions one after another in the order listed in the program

A

Sequence structure

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

Can contain any number of tasks, but there is no option to branch off and skip and of the tasks

A

Sequence structure

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

You ask a question and take one of two courses of actions

A

Selection structure

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

Also known as decision structure or an if-then-else or dual-alternative ifs/selection

A

Selection structure

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

In a ______ structure, you continue to repeat actions while a condition remains true

A

loop

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

Also called repetition or iteration

A

Loop structure

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

Programmers call this a while…do (or while loop)

A

Loop structure

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

Attaching structures end-to-end

A

Stacking

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

End structure in statements (in pseudocode)

A
  1. Endif: ends an if-then-else structure
  2. Endwhile: ends a loop structure
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Placing one structure within another

A

Nesting

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

A group of statements that execute as a single unit

A

Block

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

Reads the first input data record outside the loop where the rest of the input is read

A

Priming Read (or priming input)

17
Q

Loops must follow this order:

A
  1. First ask a question
  2. Take action based on the answer
  3. Return to ask the question again
18
Q

Writing a structured program provides:

A
  1. Clarity
  2. Professionalism
  3. Efficiency
  4. Maintenance
  5. Modularity
19
Q
A