Breakdown

Line: Method Line
Medium Difficulty Learning Outcome Four Exercise
Type: Exercise
You should have completed: Console Menu This topic leads to: Geometry Calculation

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

  1. For each of the everyday tasks below write down the steps involved
  2. 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.
  3. 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.
  4. Discuss your findings with each other.

Scenarios

  1. Getting up in the morning
  2. A car journey to a holiday cottage in Wales
  3. 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.