Cambridge International AS Level · Computer Science (9618)

Algorithm Design and Problem-solving:練習題

5 條多項選擇題即時批改,另有 5 條文字題附完整解題步驟,全部圍繞「Algorithm Design and Problem-solving」。

10 條題目25 免費,無需登記
第 1 題
1

A programmer needs to document an algorithm that calculates the area of a circle. The requirements are:
1. Input the radius (\(r\)).
2. Check if \(r\) is greater than 0.
3. If valid, calculate \(Area = 3.14159 \times r^{2}\).
4. Output the result.

Which tool uses standard geometric symbols such as parallelograms for input/output and diamonds for decisions to represent this logic?

第 2 題
1

Study the following pseudocode snippet:

Total ← 0
FOR i ← 1 TO 5
  INPUT Value
  IF Value > 10 THEN
    Total ← Total + 1
  ENDIF
NEXT i


If the input values are 5, 12, 10, 15, and 8, what will be the final value of Total?

第 3 題
1

Consider the following pseudocode intended to find the smallest value in an array List with indices from 1 to 10:

Min ← List[1]
FOR Index ← 2 TO 10
  IF List[Index] < Min THEN
    Min ← List[Index]
  ENDIF
NEXT Index


If List contains the values [40, 30, 50, 20, 20, 10, 60, 5, 80, 100], how many times will the assignment Min ← List[Index] be executed?

第 4 題
1

An algorithm is being developed using stepwise refinement. Which of the following best describes this process?

第 5 題
1

A programmer is designing an algorithm to process a list of 500 employee names stored in a 1D array. The names are currently unsorted. The goal is to find the position of a specific name, "Zackary", within the array.

Which search algorithm must be used in this scenario, and what is the maximum number of comparisons required to determine if the name is not in the list?

第 6 題
2

In the context of Algorithm Design and Problem-solving, identify the computational thinking technique that involves hiding unnecessary details to focus on the essential characteristics required for a specific purpose.

先自己寫一次答案,再對照解題步驟。

第 7 題
3

Consider the following pseudocode snippet that performs a linear search on an array Data[1:5] containing the values [12, 7, 25, 14, 9]:

Found ← FALSE
Index ← 1
WHILE Index <= 5 AND NOT Found
  IF Data[Index] = 14 THEN
    Found ← TRUE
  ELSE
    Index ← Index + 1
  ENDIF
ENDWHILE


What is the final value of Index when the loop terminates?

先自己寫一次答案,再對照解題步驟。

第 8 題
5

A linked list is implemented using a 1D array of records. The list contains three nodes with StartPointer = 2:
- List[1]: Data = "Cat", NextPointer = -1
- List[2]: Data = "Apple", NextPointer = 3
- List[3]: Data = "Banana", NextPointer = 1

What is the third data value accessed when traversing the linked list from the start pointer?

先自己寫一次答案,再對照解題步驟。

第 9 題
6

A software developer is creating a computerized model of a city's public transport system. During the design phase, the developer applies abstraction and decomposition.

(a) Explain the purpose of abstraction when creating this model. (2 points)

(b) Suggest two details that would be essential to include in the model and two details that could be ignored through abstraction. (2 points)

(c) The task "Calculate Journey Time" needs to be broken down. Use decomposition to identify two sub-tasks that would be required to calculate the total travel time between two bus stops. (2 points)

先自己寫一次答案,再對照解題步驟。

第 10 題
4

Consider the following pseudocode function:


FUNCTION CalculateScore(Data[1:4] : INTEGER) RETURNS INTEGER
  DECLARE Result : INTEGER
  Result ← 0
  FOR i ← 1 TO 4
    IF Data[i] MOD 2 <> 0 THEN
      Result ← Result + (Data[i] * 2)
    ELSE
      Result ← Result + (Data[i] DIV 2)
    ENDIF
  NEXT i
  RETURN Result
ENDFUNCTION


If the array passed to the function contains the values [3, 8, 5, 4], what is the value returned by the function?

先自己寫一次答案,再對照解題步驟。

* thinka提供的內容由AI生成,可能並非總是準確或最新。請將其用作輔助資源,並與官方材料進行核實。

你已看過標準答案,接下來輪到批改你的答案。

這一頁可以告訴你好答案的樣子,卻無法指出你的答案欠缺什麼。thinka 按真實評分準則批改你的文字答案,約 15 秒完成。

想多做幾條同類題目?立即開始練習呢個課題,即做即批改。

立即練習