Chapter 3 Flashcards
What is another phrase for sphaghetti code?
Unstructured program
Define “structure”
It is a basic unit of programming logic.
- Sequence
- Selection
- Loop
These are types of ______.
structures
This structure type performs actions or tasks in order, one after the other.
Sequence
What is another phrase for a “selection structure”
“Decision structure”
This can only result in one of two opposing values
Boolean expression
What are the values of a Boolean expression?
- True or False
2. Yes or No
In a flowchart, what shape would a Boolean expression be written in?
Diamond, because it is a decision-making symbol
What is the end-structure statement used in pseudo code?
“endif”
If-else decisions can also be called?
“dual-alternative ifs” and “dual-alternative selections”
Single-alternative selections use the word “_____”, rather than “else”
then
The action(s) that occur within a loop are called
the loop body
What is the starting statement and end-structure statement associated with while loops?
“while” and “endwhile”
What are other words for “looping”
“repetition” or “iteration”
Combining structures end to end is called ______.
stacking structures
Placing a structure within another structure is called
Nesting structures
A _____ is a group of statements that execute a single unit
block
Structured programs include
Any or all of the 3 types of structures
Where can you add other structures onto a pre-existing structure?
At an entry point or exit point
What is another word for “priming read”?
“Priming input”
The priming input is…
an added statement that gets the first input value in a program.
A structured program may contain more _______ than an unstructured one.
instructions
What are the 5 benefits of structured code?
- Clarity
- Professionalism
- Efficiency
- Modularity
- Maintenance
“Go to” statements of the olden days allowed ________
the mainline logic to “go to” any other part of the program, thus breaking out of a structure prematurely.
What are the 3 main drawbacks of spaghetti code? They are:
- ______ to _____
- difficult to _____
- difficult to implement as ______ _____ for ______ _______
prone to error; reuse; building blocks, larger applications
The purpose of _____ ____ is to keep the initial value separate from all consequent values in a structure loop.
Priming Input
What is the significance of a priming input?
Its existence keeps a program structured.
Testing a condition is the equivalent of evaluating a _______ ________.
Boolean expression.
The branch in which no action is taken
Null branch
What’s another phrase for a null branch?
Null case
A block is a ________ of steps that execute a single unit.
sequence
A condition is NOT tested more than once in a _________ ________.
selection structure
A loop must always return to its _________ statement of _______.
conditional; origin
A structure that continues to repeat a process as long as some condition remains true.
a While loop
What are the 2 alternative names for a loop structure?
- repetition
2. iteration
What is a synonym for priming input?
Priming read
A name to describe structured programming
Goto-less programming
A sequence structure can contain any number of tasks. True or False?
True