Chapter 3 Flashcards

1
Q

what is spaghetti code

A

messy programs that are difficult to read

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

structure

A

basic unit of programming logic

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

what are the three types of structures

A
  1. sequence
  2. selection (decision)
  3. loop
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

sequence structure

A

performs tasks in order

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

selection structure (decision structure)

A
  1. takes one of two actions based on testing condition. (AKA evaluating a Boolean expression)
  2. also called if-then-else
  3. dual-alternative ifs or single-alternative ifs
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

loop structure

A

repeat actions while a condition stays true

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

dual-alternative ifs

A
  1. contains 2 alternatives
  2. if-then-else structure
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

single-alternative ifs

A

if-then structure

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

null case

A

situation where nothing is done

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

loop structure (repetition/iteration)

A
  1. repeats a set of actions while a condition stays true (loop body)
  2. “while…do” or “while loop”
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

stacking structures

A

attaching structures end to end

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

end-structure statement

A

indicates end of a structure

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

what statement ends an if-then-else structure

A

endif

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

what statements ends a loop structure

A

endwhile

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

nesting structure

A
  1. placing one structure within another
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What characteristics are in structures programs

A
  • includes combination of three basic structures
  • single entry point and single exit point
17
Q

priming input ( priming read)

A

reads first input data record

is outside the loop that reads rest of the records

helps keep program structured