Algorithm 5

Carry out the following instructions.

  1. Draw a box, label the box A, write the number 1 in box A
  2. Draw a box, label the box S write the number 0 in box S
  3. Draw a line that values may be written on, label the line Output
  4. If the number in box A is less than 6 then do the next instruction, otherwise do instruction 8
  5. Replace the number in box S with the number in box S plus the number in box A
  6. Replace the number in box A with the number that is one more than the number currently in box A
  7. Go back and do instruction 4 again
  8. Write the number in box S on the line labeled Output
  9. You are done

Describe the significance of the number on the Output line.

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

How did the number 0 put initially in box S in instruction 3 affect the result?