Topic 3 Flashcards
a logically snarled program statement
Spaghetti Code
This can be a result of poor program
design
Spaghetti code
Programs that use spaghetti code logic
are known to be ____________ __________ :
they do not follow rules of structured
logic
unstructured programs
The issue with spaghetti code is not that it doesn’t work , it is the program ________ and _____________.
readability, maintainability
: a basic unit of programming logic
structure
Any program can be constructed from only
three basic types of structures
Sequence
Selection
Loop
___________structure directs the
computer to process program
instructions one after another in the
order listed in the program
sequence
_________ structure, you ask a question and,
depending on the answer, you take one of two courses of action
*Also known as decision structure or an if then else
selection
Selection structure also termed as if-the-else or ____ ________ ____
dual-alternative ifs/selection
____ structure, you continue to repeat actions
while a condition remains true
* Also called repetition or iteration
loop
Programmers call this a
while … do (or simply while
loop ), as it fits the following
Loop structure
What are the three structures?
Stacking
Nesting
Block
_______: attaching structures end to
end
Stacking
End structure statements (in
pseudocode)
Stacking
________ is the placing of one structure within another
*Indent the nested structure’s statements (for readability)
Nesting