This example illustrates a number of points :
1. The variable student_total is initialized before the DOWHILE condition is executed.
2. As long as student_total is less than 50 (that is ,the DOWHILE condition is true ), the statement block will be repeated.
3. Each time the statement block is executed, one instruction with in that block will cause the variable student_total to be incremented.
4. After 50 iterations,student_total will equal 50, which causes the DOWHILE condition to become fale and the repetition to case.
It is important to realise that the initializing and subsequent incrementing of the variable tested in the condition is an essential feature of the DOWHILE construct . The repetition control structure is discussed fully in Chapter 5.
Chapter summary
In this chapter , six basic computer operations were listed , along with pseudocode words and keywords to represent them. These operations were to receive information put out information perform arithmetic assign a value to a variable decide between two alternete actions and repeat a group of actions . Typical pseudocode examples were given as illustrations and the importance of using meaningful names was discussed.
The Structure Theorem was introduced it states that it is possible to write any computer program by using only three basic control structures sequence selection and repletion .Each control structures was defined and its association with each of the six basic computer operations was indicated . Pseudocode examples for each control structure were provided.