Breakdown
Summary
In order to write a program to solve a problem, a programmer must first understand the problem and have a solution. A key skill in turning a solution into a program is breaking down the steps of the solution into sufficiently small parts that they can be represented in the syntax of a programming language.
This exercise is to practice that process and is best done in a small group so that you can discuss and critique each other's solutions.
Task
- For each of the everyday tasks below write down the steps involved
- Break each of those steps down into more steps (including conditions if necessary) until you reach a point where each step is 1 action and unambiguous.
- Swap your instructions list with another student and see if there are ambiguities or complexities remaining in their list as they do the same with yours.
- Discuss your findings with each other.
Scenarios
- Getting up in the morning
- A car journey to a holiday cottage in Wales
- Posting a letter to your aunt (an old fashioned concept, but my aunt does not use e-mail
Note
This process is reflected in code by the use of
methods. Each method is a task to be performed, and when we look inside that method we see the steps involved in that task, some of which may also be methods and broken down into further detail. Bear this in mind as you start to study
methods.