| << 5.1.0- An Example in Plain English | Chapter5 | 5.2.0- Definitions >> |
Two Kinds of Statements
Note that all of the lines of your code can be divided into two types:
- Action statements carry out a task, such as showing the price of an item on a web page.
- Control statements have the task of directing the execution of the action statements. In other words, they decide how often and in which order, action statements are carried out.
In our Motorpool example, instructions such as "Fill the tank with gasoline" and "Add the oil" are action statements. The rest are control statements, such as "If the truck needs gasoline then..." or "Repeat the above steps for the next truck."
This idea of controlling which lines of code execute in what order, and how often, has several names. Some people refer to these techniques as flow control or execution order, and the sets of code that we use to control the flow of execution are called, logically enough, Control Structures.
| << 5.1.0- An Example in Plain English | Chapter5 | 5.2.0- Definitions >> |

RSS

