SCORE Overall I got a 45/50 which I think may have been my best quiz yet.

Alt text

Question number twenty-four was the first question that I got wrong. I previously thought backing up data would take the longest. But after getting it wrong I realise that even though backing it up might take a while you still have all the previous data. Sorting data would take longer because all the variables might be all random.

Alt text

Question number thirty-nine was the second question that I got wrong. In the second iteration of the loop, i is equal to 2. Thus RANDOM(1, i) returns either 1 or 2. So, the output 1 3 2 4 is not possible.

Alt text

THis one is the right anwser because the student knows that the procedure searches for a value without knowing how it does the searching. This is an example of the use of procedural abstraction.

Alt text

This one is correct because this code segment draws the three line segments shown in the figure. The first call to drawLine draws a line segment with endpoints (1, 5) and (6, 5). The second call to drawLine draws a line segment with endpoints (1, 5) and (6, 7). The third call to drawLine draws a line segment with endpoints (1, 5) and (6, 3).

Alt text

This question is right because this code segment traverses the list beginning with the second element, so it is correctly comparing only student scores to the maximum possible score, which is found by accessing scores[1]. The variable found will only be set to true when a student’s score equals the maximum possible score. The code also sets the number of iterations to LENGTH(scores) - 1 to reflect that the first list element (maximum score) is skipped.

Alt text