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

Marks 9. (a) (i) Reduced program memory usage. / The code can be simplified since the number corresponds to the TN index. 1 (a) (ii) Any value <= -1 or >=81 1 (b) [Python version] 0 1 81 VT[I] C+1 [C++ and Pascal version] 0 1 81 VT[I] C+1 1  5 (c) [Python and Pascal version] V >=1 and V<=80 V == -1 or the value in 9. (a)(ii) [C++ version] V>=1 && V<=80 V == -1 Accept V>0 , V<81 , not ( v<1 or v>80 ). 1 1 1 1 (d) Testing 1 (e) The primary reason for separating the code into two program segments, ALG1 and ALG2 , is modularity, simplifying troubleshooting and promoting code reuse. 1

RkJQdWJsaXNoZXIy ODY0MTQz