ABSTRACT

This chapter introduces three universal programming tools: iteration, conditional execution, and procedures. The do-structure allows repeated execution of a statement or a block of statements, which is one of the things computers are good at. The chapter offers the use of the do-structure for the construction of a recursive sequence. It discusses simple instances of the if structure in the context of characteristic functions. The chapter considers the problem of constructing Pascal's triangle. The while option affords an alternative way to terminate an iteration. The while option is the most general one, in the sense that the effect of any other combination of options can be reproduced using the while option alone. The while option can be used in conjunction with any other option. Conditional execution, represented by the if-structure, implements the process of decision-making in a programming language. Decisions are made based on the truth or falsehood of logical expressions.