A programmer is writing an algorithm to sort an array of exam scores in ascending order. Below is a section of the pseudocode used to swap two elements in the array scores:
IF scores[index] > scores[index + 1] THEN
temp = scores[index]
scores[index] = scores[index + 1]
scores[index + 1] = temp
ENDIF
Explain why the variable temp is needed in this algorithm.