|
|
|
|
|
|
|
Much of what you do unconsciously you once had to learn. Watch how a baby concentrates on putting one foot before the other while learning to walk. Then watch a group of three-year-olds playing tag. |
|
|
|
|
|
|
|
|
On a broader scale, mathematics never could have been developed without logical sequences of steps for solving problems and proving theorems. Mass production never would have worked without operations taking place in a certain order. Our whole civilization is based on the order of things and actions. |
|
|
|
|
|
|
|
|
We create order, both consciously and unconsciously, through a process we call programming. This book is concerned with the programming of one of our tools, the computer. |
|
|
|
 |
|
 |
|
|
Programming Planning, scheduling, or performing a task or an event. |
|
|
|
 |
|
 |
|
|
Computer A programmable device that can store, retrieve, and process data. |
|
|
|
 |
|
 |
|
|
Computer Programming The process of planning a sequence of steps for a computer to follow. |
|
|
|
|
|
|
|
|
Just as a concert program lists the actions the players perform, a computer program lists the steps the computer performs. From now on, when we use the words programming and program, we mean computer programming and computer program. |
|
|
|
 |
|
 |
|
|
Computer Program A list of instructions to be performed by a computer. |
|
|
|
|
|
|
|
|
The computer allows us to do tasks more efficiently, quickly, and accurately than we could by handif we could do them by hand at all. In order to use this powerful tool, we must specify what we want done and the order in which we want it done. We do this through programming. |
|
|
|
|
|
|
|
|
How Do We Write a Program? |
|
|
|
|
|
|
|
|
To write a sequence of instructions for a computer to follow, we must go through a two-phase process: problem solving and implementation (see Figure 1-1). |
|
|
|
|
|
|
|
|
1. Analysis and Specification. Understand (define) the problem and what the solution must do. |
|
|
|
|
|