2.1.3 Flashcards
Thinking procedurally (5 cards)
1
Q
Procedural Abstraction
A
- Allows a programmer to use a function without understanding the detail of its implementation.
- Used with data structures and in decomposition.
- Models the purpose of a subroutine without
2
Q
Problem Decomposition
A
- Breaking down a large problem into smaller parts.
- These smaller parts are easier to solve.
3
Q
Decomposition in a team
A
- Top down design, also called stepwise refinement is often used to do this.
- This technique divides a problem into levels of complexity.
- Problems are broken down over and over until each problem is a single task.
- Each task can then be solved with a single subroutine.
4
Q
Subroutines in decomposition
A
- Subroutines can be tested and developed separately.
- Consider how each subroutine is implemented.
- The subroutines need to be joined to form the whole solution.
- Start with the lowest level components and work up.
- Some tasks may be solved with an existing module or library.
5
Q
The Order of Steps
A
- It is important to consider the order in which operations are performed.
- Certain inputs may be required before processing.
- Inputs may need to be validated, this must occur after the input is received and before it is processed.
- It may be possible for several subroutines to be executed at the same time.
- Also consider how subroutines interact with one another.
- Code should be written to prevent operations occurring in an order which would cause an error or prevent the program from functioning as intended.