Login or Create an Account to view the mark scheme, comment, and add to a test
Consider the following array of four Cartesian co-ordinates called POINTS.
POINTS = [(3,7),(5,11),(1,2),(4,9)]
(a).
Write pseudocode to access the first element in the array.
[1]Consider the following pseudocode which draws a path connecting each point contained in the array POINTS.
drawLine((3,7),(5,11))
drawLine((5,11),(1,2))
drawLine((1,2),(4,9))
(b).
Rewrite the pseudocode above to achieve the same functionality both iteratively and more generally, such that POINTS may contain any four coordinates, each of the form (a, b).
[2](c).
A particular location at coordinate (7, 7) has been flagged as a private area. Augment your iterative solution from part (b) to always exclude coordinate (7, 7) and at the same time ensure any resultant path is continuous. The coordinate (7, 7) may occur in POINTS more than once.
[2]Extended Response5 MarksPremium
18 Uses61 Views2 Likes