Login or Create an Account to view the mark scheme, comment, and add to a test
Given an array of integers of length 7 called INTEGERS, the following pseudocode has been written to output the two biggest integers it contains. The algorithm should handle both negative and positive values as well as repeated values.
biggestNumber = INTEGERS[0] secondBiggestNumber = INTEGERS[1] if biggestNumber < secondBiggestNumber biggestNumber = INTEGERS[1] secondBiggestNumber = INTEGERS[0] end if loop x from 2 to 6 num = INTEGERS[x] if num > biggestNumber INSERT_CODE_HERE biggestNumber = num else if num > secondBiggestNumber secondBiggestNumber = num end if end loop
Choose the pseudocode snippet below to replace "INSERT_CODE_HERE" in order to have the above procedure function correctly.
(a).
secondBiggestNumber = biggestNumber
(b).
secondBiggestNumber = INTEGERS[x+1]
(c).
secondBiggestNumber = INTEGERS[x]
(d).
x = x + 1

Multiple Choice1 MarkPremium
32 Uses60 Views2 Likes