/* * No Commenting */ i = 0 s = 0 l: if i => n goto end s += score[i] i++ goto l end: a = s/n /* * Lousy Commenting */ i = 0 /* set i to 0 */ s = 0 /* set s to 0 */ l: if i => n goto end /* if i not less than n go to end */ s += score[i] /* add score[i] to s */ i++ /* add 1 to i */ goto l /* go to l */ end: a = s/n /* set a to s/n */ /* * Good Commenting */ /* * the code below computes a as the average value of the * "n" values that are stored in the first "n" elements of * the "score" array. */ i = 0 s = 0 l: if i => n goto end s += score[i] i++ goto l end: a = s/n /* * Anally Retentive Good Commenting */ /* * the code below computes a as the average value of the * "n" values that are stored in the first "n" elements of * the "score" array. * * the variables "s" and "i" are used as a tempoirary accumulator * of the sum so far and an index vatiable to access the array * elements. Note that the "n" values are stored in elements * 0 through "n-1" rather than 1 through n * * the initialisation code (2 lines) initialize the sum and the * index * * the loop test sees if we are done or not by comparing the * index variable to the number of elements * * the loop body adds the next value to the sum and increments * the index variable to address the next element * * finally the average is computed as the sum of all the * elements divided by the numberof elements */ i = 0 s = 0 l: if i => n goto end s += score[i] i++ goto l end: a = s/n