香港中學文憑資訊及通訊科技 模擬試卷及多項選擇題

Marks 1. (a) (i) False 1 (ii) True 1 (iii) False 1 (b) The purpose of the algorithm is to determine if one string is the reverse of another. 1 (c) Iterate over the characters in both strings ( ST1 and ST2 ) from both ends simultaneously / Check if their corresponding characters are equal. 1 + 1 2. (a) A motion sensor should be used. 1 (b) A temperature sensor should be used. It measures the room's temperature. / If the temperature is too low, the sensor signals the heating system to increase the heat. / If the temperature is too high, it signals the air conditioning system to cool the staff room. 1  3 3. (a) 2 1 (b) (i) A[1] A[2] A[3] A[4] A[5] A[6] A[7] F T T T T T T A[1] = F (1 mark) A[2] to A[7] = T (1 mark) 2 (ii) A[1] A[2] A[3] A[4] A[5] A[6] A[7] F T T T T F F A[6], A[7] = F (1 mark) 1 4. (a) (i) 35 15 10 1 1 (ii) 30 25 35 1 1 (b) (i) 40 ← Bottom of B 1 (b) (ii) 40 35 20 15 ← Bottom of B 1 1 if all correct (iii) The purpose of the algorithm is to sort a stack of crates in ascending order of number of oranges in it. 1

RkJQdWJsaXNoZXIy ODY0MTQz