Computation
To perform computation, a program contains some data, called data structures or its state. Input comes from a wide variety of sources, and output can go to a wide variety of destinations. The most interesting cases are to/from another program and to/from other parts of a program. Inputs to a part of a program are called arguments and outputs from a part of a program are often called results.
As programmers, out job is to write code that does the computation: 1. Correctly: a program is useless if it produces wrong results. 2. Simply: any part of a program should be as simple as possible to perform the task. 3. Efficiently
Our main tool for organizing a program is to break up a big computation into many little ones by using the following techniques: - Abstraction: hide details we don't need by using a facility behind a convenient and general interface. - Divide and conquer: take a large problem and divide it into several little ones.
In C++ a symbolic constant is used for expressions where constants appear in the code. Constants cannot be modified. We initialize the constant the following way:
const double pi=3.14159;