# Algorithm 6

Set-up instructions:

- Draw a line that values may be written on, label the line Input
- On the line labeled Input write the following numbers: 3 7 14 9 7 2

Carry out the following instructions using the values in the *Input* line.

- If there are no numbers on the Input line do the next instruction, otherwise do instruction 3
- You are done
- Draw a box, label the box S, write the number 0 in box S
- Draw a box, label the box X write the number 999 in box X
- Draw a line that values may be written on, label the line Output
- If there are still numbers on the line labeled Input then do the next instruction, otherwise do instruction 10
- Replace the number in box X with the the next number on the line labeled Input, erase from the Input line the number that was copied to box X
- Replace the number in box S with the sum of the number that is currently in box S plus the number in box X
- Go back and do instruction 6 again
- Write the number in box S on the line labeled Output
- You are done

Describe the significance of the number on the Output line.

Describe the value in box S after each execution of instruction 8.

How did the number 999 put initially in box X in instruction 4 affect the result?

What if there were different numbers on the *Input* line?