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

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

練習を始める