10.3 Thinking Procedurally Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

Procedural Decomposition

A

Breaking a problem into a number of sub-problems, so that each sub-problem accomplishes an identifiable task (sub-problems may be divided even more)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Structured programming

A

A method of writing a computer program which uses:
- Modularization for program structure and organisation (breaking the problem down into subroutines)
- Structured code for the individual modules - that is, code which uses the basic constructs of sequence, selection and iteration
- Recursion

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are hierarchy charts often used for?

A

To show overall program structure

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Hierarchy chart

A
  • Each logical process is broken down into smaller components until it cannot be broken down any further
  • Execution takes place from left to right, always at the lowest level component
  • Selection and iteration are not shown in a hierarchy chart
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Modularisation further advantages

A
  • Large programs are broken down into subtasks/subroutine that are easier to program and manage
  • Each subroutine can be individually tested
  • Modules can be re-used several time in a program
  • Frequently used modules can be saved in a library and used by other programs
  • Several programmers can simultaneously work on different modules, shortening development time
  • Easier to find errors in small self contained modules
  • Well-organised, modular program is easier to follow
  • Easier to find which module needs to be changed
  • Self-contained modules mean that the change should not affect the rest of the program
  • New features can be added by adding new modules
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Modularisation advantages

A
  • Programs are more easily and quickly written
  • Programs are more reliable and have fewer errors
  • Programs take less time to test and debug
  • Programs are easier to maintain
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Good programming practice techniques

A
  • Meaningful indentifiers
  • Define and document the inputs, outputs and preconditions for each sub-procedure
  • Add lots of meaningful comments within the program
  • At the bottom level, each sub-procedure should perform a single task
  • Keep each sub-procedure self-contained by passing parameters and using local variables
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Identifying the components

A

Involves writing procedures or functions and passing parameters

How well did you know this?
1
Not at all
2
3
4
5
Perfectly