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 秒で採点します。

同じような問題をもっと解きたい?このトピックの新しい問題を、解きながら採点。

練習を始める