FunctionsΒΆ

cartoon

The goal of the previous section was to introduce you to the concept of structured programming design. The reasons programs are designed using this method are:

  • easier to develop accurately

  • develop in less time

  • easier to read and understand

  • easier to modify and maintain

  • easier to test and correct errors

There are two groups of methods to use in structured programming to ensure the above occur. The first is the three basic control structures we have learned in the previous chapter, sequence, selection and repetition. The second method is modularity. A complicated problem is broken down into smaller problems. Each of these smaller problems is coded. The small sections of code are then organized to make the solution. Modularity in programming is usually done with subroutines or procedures or normally just called functions.