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 วินาที

อยากฝึกโจทย์แบบนี้เพิ่มไหม เริ่มฝึกหัวข้อนี้ได้เลย ตรวจให้ทันทีทุกข้อ

เริ่มฝึกเลย