Chapter 3 Flashcards
(22 cards)
Snarled, unstructured program logic
Spaghetti code
Programs that do not follow the rules of structured logic.
Unstructured program
Program that do follow the rules of structured logic.
Structured programs
a basic unit of programming logic; each structure is a sequence, selection, or loop.
Structure
This contains a series of steps,executed in order. this can contain a number of tasks, but there is no option to branch off and skip any of the tasks.
Sequence Structure
Contains a question, and depending on the answer, takes one of the two courses of action before continuing with the next task.
Selection or Decision Sturcture
Designates the end of a pseudocode structure
End Structure Statement
Another name for selection/decision statement.
If-then-else
Define one action to be taken when the tested condition is true and another action to be taken when it is false.
Dual-Alternative selections (Defenitive Ifs)
Take action on just one branch of the decision.
Single-Alternative selections (Single Ifs)
The branch of a decision in which no action is taken.
Null Case
Continues to repeat actions while a test condition remains true.
Loop Structure
The set of actions that occur within a loop.
Loop Body
Another name for a loop structure.
Repetition (Iteration)
A process continues while some conditions continues to be true.
While do (While Loop)
The act of attaching structures end to end.
Stacking Sturctures
The act of placing a structure within another structure.
Nesting Structures
A Group of statements that executes as a single unit.
Block
The statement that reads the first input data record prior to starting a structured loop.
Priming Input (Priming Read)
What do programmers promote by using structured programs?
Clarity, Professionalism, Efficiency, and Modularity.
A Sequence, Selection, and Loop.
What are the types of structures in a program?
- Programs only consist of three basic structures; a sequence, loop, and/or a selection. A structure may contain one, two, or all of these structures.
- Each structure has to have only one entrance and one exit point.
3 . Structures can only be stacked or connected to one another only at their entry or exit point.
- Any structure can be nested within another structure.
What are the rules to having a structured program?