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.