Pearson Edexcel GCSE (9-1) · Computer Science (1CP2)

Develop code:練習題

5 條多項選擇題即時批改,另有 4 條文字題附完整解題步驟,全部圍繞「Develop code」。

9 條題目30 免費,無需登記
第 1 題
1

Which of the following describes the benefit of using meaningful identifiers when writing a program?

第 2 題
1

A student writes a program to calculate the average of three numbers but accidentally uses the formula avg = a + b + c / 3. What type of error is this?

第 3 題
1

A developer is using abstraction to design a flight simulator. Which of the following would be an example of applying abstraction in this context?

第 4 題
1

A programmer wants to make their Python code easier for others to understand. Which of these techniques uses non-executable text to describe what a specific section of the code does?

第 5 題
1

Consider the following pseudocode segment:

x = 10
y = 5
IF x > y THEN
  x = x - y
ELSE
  y = y - x
ENDIF

What is the final value of x?

第 6 題
5

A developer is refining a program to make it more maintainable. Identify two techniques mentioned in the specification that improve code readability.

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

第 7 題
5

A program crashes when a user enters a string instead of a number. Identify the type of error and suggest a technique to prevent it.

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

第 8 題
7

A developer needs to create a program that manages a 2D array representing a 3x3 grid for a game.

(a) Write a code statement to initialize a 3x3 2D array named grid with the character "X" in all positions.
(b) Explain how to access the element in the second row and third column.
(c) Write a nested loop structure to print all elements of the 2D array to the screen.

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

第 9 題
8

A robot moves on a coordinate plane. It starts at \((0,0)\). It receives a list of commands: "N", "S", "E", "W".

(a) Create an algorithm using a case/switch selection or nested IFs to update x and y coordinates based on a variable cmd.
(b) Use a loop to process a list of commands: ["N", "N", "E", "S"]. Show the final values of x and y.
(c) Explain how decomposition was used to solve this problem.

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

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

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

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

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

立即練習