Page 1334 - AP Computer Science A, 7th edition
P. 1334

26. (D) Segment I is incorrect because num is not an index in the loop: It is a value in the array. Thus, the correct test is if (num > 0), which is correctly used in segment II. Segment III is a regular for loop, exactly equivalent to the given while loop.


































































































   1332   1333   1334   1335   1336