Algorithms vs. programs (2)
Here we express our algorithms in (precise) English.
Steps may be numbered consecutively:
The extent of a conditional is indicated by indentation:
7. If …: 7.1. Do this. 7.2. Do that.
The extent of a loop is indicated by indentation:
8. While …, repeat: 8.1. Do this. 8.2. Do that.
Do this and then do that.
Do this and then do that, but only if condition … is true.
Do this and then do that, as long as condition … is true.