1. a. This is close, but remember we start counting at 0, not 1, so this does the sum from 0, 1, ..., n-1 b. Here we're not updating sum every time through the loop, so each time we access sum in temp = sum + (i+1) the value will still be 0. The final value of temp (and therefor sum) when this code finishes will just be n. c. Here we're updating sum, but we're not accumulating. Instead, each time sum will just get i+1. Again, when we're done, sum will just be n. d. This is the same as c., except now we've broken it into two steps, first assigning (i+1) to temp and then temp to sum 2. The problem is that only the last if-else statement actually has any effect, which results in red being chosen 1/4 of the time (when color is 3) and yellow 3/4 of the time (when color is 1, 2 or 4). For example, if color is 1, the first if statement is true and the fill color is set to blue, however, when it get's to the third if (color == 3), this if false and so the code goes to the else clause and sets the fill color to "yellow".