September 1998
Intermediate to advanced
848 pages
20h 13m
English
One of the most common tasks for a computer is sorting, so we'll develop a program to sort integers. We'll take a black box approach and think in terms of input and output. The overall plan, shown in Figure 13.2, is pretty simple.
At this point, the program is still too vaguely defined for us to begin writing code. The next step is to identify the main tasks that the program must do to accomplish our goals. We can break the example down to three such tasks:
Read the numbers.
Sort them.
Print the sorted numbers.
Figure 13.3 shows this breakdown as we descend from the top level of ...
Read now
Unlock full access