CHAPTER 1. THE MENTAL LANDSCAPE 9
interest should be computed by multiplying the principal by 0.04. A program needs some way of expressing this type of decision. In Java, it could be expressed using the following “if statement”:
This will have the same effect as repeating all the house-drawing instructions in each place.
Programs must be designed. No one can just sit down at the computer and compose a
CHAPTER 1. THE MENTAL LANDSCAPE 10
∗ ∗ ∗
So, in practice, top-down design is often combined with bottom-up design. In bottom-up design, the approach is to start “at the bottom,” with problems that you already know how to solve (and for which you might already have a reusable software component at hand). From there, you can work upwards towards a solution to the overall problem.