Chapter 3 Flashcards

1
Q

What is another phrase for sphaghetti code?

A

Unstructured program

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

Define “structure”

A

It is a basic unit of programming logic.

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

These are types of ______.

A

structures

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

This structure type performs actions or tasks in order, one after the other.

A

Sequence

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

What is another phrase for a “selection structure”

A

“Decision structure”

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

This can only result in one of two opposing values

A

Boolean expression

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

What are the values of a Boolean expression?

A
  1. True or False

2. Yes or No

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

In a flowchart, what shape would a Boolean expression be written in?

A

Diamond, because it is a decision-making symbol

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

What is the end-structure statement used in pseudo code?

A

“endif”

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

If-else decisions can also be called?

A

“dual-alternative ifs” and “dual-alternative selections”

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

Single-alternative selections use the word “_____”, rather than “else”

A

then

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

The action(s) that occur within a loop are called

A

the loop body

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

What is the starting statement and end-structure statement associated with while loops?

A

“while” and “endwhile”

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

What are other words for “looping”

A

“repetition” or “iteration”

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

Combining structures end to end is called ______.

A

stacking structures

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

Placing a structure within another structure is called

A

Nesting structures

17
Q

A _____ is a group of statements that execute a single unit

18
Q

Structured programs include

A

Any or all of the 3 types of structures

19
Q

Where can you add other structures onto a pre-existing structure?

A

At an entry point or exit point

20
Q

What is another word for “priming read”?

A

“Priming input”

21
Q

The priming input is…

A

an added statement that gets the first input value in a program.

22
Q

A structured program may contain more _______ than an unstructured one.

A

instructions

23
Q

What are the 5 benefits of structured code?

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

“Go to” statements of the olden days allowed ________

A

the mainline logic to “go to” any other part of the program, thus breaking out of a structure prematurely.

25
Q

What are the 3 main drawbacks of spaghetti code? They are:

  1. ______ to _____
  2. difficult to _____
  3. difficult to implement as ______ _____ for ______ _______
A

prone to error; reuse; building blocks, larger applications

26
Q

The purpose of _____ ____ is to keep the initial value separate from all consequent values in a structure loop.

A

Priming Input

27
Q

What is the significance of a priming input?

A

Its existence keeps a program structured.

28
Q

Testing a condition is the equivalent of evaluating a _______ ________.

A

Boolean expression.

29
Q

The branch in which no action is taken

A

Null branch

30
Q

What’s another phrase for a null branch?

31
Q

A block is a ________ of steps that execute a single unit.

32
Q

A condition is NOT tested more than once in a _________ ________.

A

selection structure

33
Q

A loop must always return to its _________ statement of _______.

A

conditional; origin

34
Q

A structure that continues to repeat a process as long as some condition remains true.

A

a While loop

35
Q

What are the 2 alternative names for a loop structure?

A
  1. repetition

2. iteration

36
Q

What is a synonym for priming input?

A

Priming read

37
Q

A name to describe structured programming

A

Goto-less programming

38
Q

A sequence structure can contain any number of tasks. True or False?