香港中學文憑資訊及通訊科技 模擬試卷及多項選擇題
Consider the values in the array ARR and the module S , answer questions 30 to 31. ARR ARR[1] ARR[2] ARR[3] ARR[4] Judy May Ada Beth MODULE S RESULT TRUE FOR K 2 to 4 IF ARR[K] < ARR[K-1] THEN RESULT FALSE PRINT RESULT 30. Assuming Module S is executed, how many times does the line ' RESULT ← FALSE ' run in Module S ? A. 0 B. 1 C. 2 D. 3 31. What does the value in variable RESULT indicate? A. All items in the array ARR are unique. B. Some items in the array ARR are duplicated. C. The array ARR is sorted in ascending order. D. The array ARR is sorted in descending order. 32. Which of the following lines of code will produce a syntax error? A. WHILE A > (B + 2 * B) DO B. B B / (2*B-B-B) C. IF (A > B) and (A < B) THEN D. C + 2 C + B 33. In programming, what is the primary purpose of using a constant? A. To store a value that can be changed multiple times throughout the code. B. To hold a value that remains unchanged throughout the program. C. To track user inputs dynamically during program execution. D. To increase the processing speed of the program.
Made with FlippingBook
RkJQdWJsaXNoZXIy ODY0MTQz