DSE 資訊及通訊科技:演算法與偽代碼

Algorithms & Pseudocode

20 題 MCQ(基礎 1 · 中等 16 · 高階 3),撳入去睇完整解說同上一題/下一題。未學過呢個課題?先睇 ICT 自學路徑單元 7。

  1. 中等ICT-ALGO-001

    1. In the pseudocode used in this course, the symbol ← means:

  2. 中等ICT-ALGO-002

    2. What is the output of this pseudocode? sum ← 0; FOR i FROM 1 TO 3; sum ← sum + i; END FOR; OUTPUT sum

  3. 中等ICT-ALGO-003

    3. IF ... THEN ... ELSE ... ENDIF is an example of:

  4. 中等ICT-ALGO-004

    4. A pass should be given for a mark of 50 or above. The algorithm says IF mark > 50 THEN OUTPUT "Pass" ELSE OUTPUT "Fail" ENDIF, and mark is 50. What is true?

  5. 中等ICT-ALGO-005

    5. FOR i FROM 1 TO 4 means i takes the values:

  6. 中等ICT-ALGO-006

    6. What is the output of this pseudocode? n ← 1; WHILE n < 8; n ← n * 2; END WHILE; OUTPUT n

  7. 中等ICT-ALGO-007

    7. A program runs and prints the wrong total because the loop adds one extra time. This is a:

  8. 中等ICT-ALGO-008

    8. Which is a syntax error?

  9. 中等ICT-ALGO-009

    9. Valid marks are from 0 to 100 inclusive. Which pair is boundary test data?

  10. 中等ICT-ALGO-010

    10. Which input is abnormal test data for a numeric mark?

  11. 中等ICT-ALGO-011

    11. A dry run is:

  12. 中等ICT-ALGO-012

    12. When a question asks for the output of a given algorithm, you should:

  13. 中等ICT-ALGO-013

    13. What is the output of this pseudocode? a ← 3 b ← 4 a ← a + b OUTPUT a OUTPUT b

  14. 中等ICT-ALGO-014

    14. What is the output? p ← 10 FOR k FROM 1 TO 3 p ← p - 2 END FOR OUTPUT p

  15. 高階ICT-ALGO-015

    15. What is the output? score ← 40 bonus ← 0 IF score >= 50 THEN bonus ← 10 ELSE bonus ← 5 ENDIF OUTPUT score + bonus

  16. 高階ICT-ALGO-016

    16. How many times does the body of FOR i FROM 1 TO 5 run, and what is n after n ← 0 followed by n ← n + 1 inside that loop?

  17. 基礎ict-u07-d01

    17. In course pseudocode, the symbol <- means:

  18. 中等ict-u07-d02

    18. For an algorithm that accepts marks from 0 to 100 inclusive, suitable boundary test data includes:

  19. 中等ict-u07-d03

    19. A dry run of an algorithm means:

  20. 高階ict-u07-d04

    20. In an algorithm with IF mark >= 50 THEN ... ELSE ... ENDIF, the statements: