Tracing the summation program

 

Find the value at various points. They go in order the way the program processes. 

 

Description

sum

sumEachSet

counter

numberToAdd

after line 9

 

 

 

 

after first time line 10

 

 

 

 

after first time line 12

 

 

 

 

after first time line 13

 

 

 

 

after first time line 15

 

 

 

 

after second time line 13

 

 

 

 

after second time line 15

 

 

 

 

after third time line 13

 

 

 

 

after third time line 15

 

 

 

 

after the number increments on line 13, but before the test (fourth time to line 13)

 

 

 

 

before line 18

 

 

 

 

after line 18

 

 

 

 

after line 10 the second time

 

 

 

 

after line 12 the second time

 

 

 

 

after line 13

 

 

 

 

after line 15