There was a most ingenious architect who had contrived a new method for building houses, by beginning at the roof, and working downward to the foundation.
JONATHAN SWIFT, Gulliver’s Travels
A program can be thought of as consisting of subparts, such as obtaining the input data, calculating the output data, and displaying the output data. C++, like most programming languages, has facilities to name and code each of these subparts separately. In C++ these subparts are called functions. In this chapter we present the basic syntax for one of the two main kinds of C++ functions—namely those designed to compute a single value. We also discuss how these functions can aid in program design. We begin with a discussion of a fundamental design principle.
You should read Chapter 2 and at least look through Chapter 1 before reading this chapter.