2. 1. 3 Thinking Procedurally Flashcards

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

Identify the components of a problem (Decomposition)

A
  • Thinking procedurally makes task of writing program simpler by breaking problem down into smaller parts which are easier to understand and consequently easier to design
  • First stage of thinking procedurally is problem decomposition, large, complex problem broken down into smaller subproblems that can be solved more easily
  • Makes problem more manageable, can be divided between group off people according to skill sets off different individuals
  • For example, you need to organise a birthday party, you have 10 people to help you, 3 chefs can deal with the cake, 5 people can organize tables, 2 people can keep the individual occupied
  • Top-down design is a common way off decomposing a problem, also known as stepwise refinement
  • Preferred method to approach large problems, broken down into levels, higher levels provide overview of problem, lower levels specify in detail the components of this problem
  • Aim of the top-down approach is single tasks that are ideally self-contained modules or subroutines (in my example, chefs not affected by tables being sorted out)
  • Each of these tasks can be solved and developed, once programmed the subroutines can be tested separately before being bought together and finally integrated
  • Chefs finish the cake, the cake tastes fine, Tables are organised and clean, approved by the chefs, the individual has been occupied, they are playing a game
  • When everything comes together, the birthday party has been implemented, the individual enjoys their party with their peers and family
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Identify the components of a solution

A
  • At this stage, details about how each component is implemented are considered, in the same way we broke down the problem, we must build up to its solution
  • Programmer must evaluate component of problem allocated to them, assess how it can be solved best
  • Lowest-level components considered at this stage, slowly builds up to higher stages
  • During this stage, its useful to identify tasks which could be solved using an already existing module, subroutine or library
  • Reducing complexity of development stage by picking up sections in which reusable components can be used is another benefit of the top-down design
  • Components of solution finally combined to form a full working solution
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Order of steps needed to solve a problem

A
  • When constructing final solution, thinking about order in which operations are performed becomes important
  • Inputs may need to be entered before processing can be carried out, these same inputs may also need to be validated before passing it onto the next subroutines which also needs to be considered
  • May be possible that multiple subroutines can be executed simultaneously, programmers must identify where this is possible in order to save time when running the program (quicker load times)
  • Some subroutines may require data from other subroutines before they are able to execute, this therefore cannot be executed simultaneously
  • Order in which subroutines are executed needs to be established as well as how they interact with each other based on their role in solving the problem
  • May seem fairly obvious and natural to us, but this must be explicitly written into software for program to work in the way we want it to work
How well did you know this?
1
Not at all
2
3
4
5
Perfectly