Cambridge International AS Level · Computer Science (9618)

Programming: แบบฝึกหัด

ข้อปรนัย 5 ข้อ ตรวจให้ทันทีที่ตอบ และข้อเขียน 3 ข้อ พร้อมวิธีทำละเอียด ทั้งหมดจากเรื่อง Programming

8 ข้อ17 คะแนนฟรี ไม่ต้องสมัคร
ข้อ 1
1 คะแนน

A programmer needs to define a constant for the maximum number of attempts allowed in a login system. Which pseudocode statement correctly performs this declaration and initialisation?

ข้อ 2
1 คะแนน

Consider the following pseudocode fragment:
IF Temperature > 30 THEN
  OUTPUT "Hot"
ELSE
  IF Temperature < 10 THEN
    OUTPUT "Cold"
  ELSE
    OUTPUT "Moderate"
  ENDIF
ENDIF
What is this specific structure an example of?

ข้อ 3
1 คะแนน

A developer is deciding between using a pre-condition loop (WHILE...ENDWHILE) and a post-condition loop (REPEAT...UNTIL) for a specific task. What is the primary functional difference that would justify using a pre-condition loop?

ข้อ 4
1 คะแนน

What is the main difference between a procedure and a function in structured programming?

ข้อ 5
1 คะแนน

A programmer uses the following pseudocode for a string manipulation task:

DECLARE MyString : STRING
MyString ← "Cambridge"
OUTPUT RIGHT(MyString, 6)

What will be the output of this code?

ข้อ 6
5 คะแนน

Evaluate the output of the following pseudocode expression, assuming standard string library functions:
LCASE(SUBSTR("COMPUTER SCIENCE", 10, 4)) & STR(LENGTH("9618"))

ลองเขียนคำตอบด้วยตัวเองก่อน แล้วค่อยเทียบกับวิธีทำ

ข้อ 7
3 คะแนน

A program is being developed to manage scores for a competitive game.
Write pseudocode to declare a constant called MAX_PLAYERS with a value of 50 and a variable called CurrentScore that can hold decimal values. Initialise CurrentScore to 0.0.

ลองเขียนคำตอบด้วยตัวเองก่อน แล้วค่อยเทียบกับวิธีทำ

ข้อ 8
4 คะแนน

A string variable UserID contains a value such as "ST1234".

Write pseudocode to:
1. Extract the first two characters of the string.
2. Convert these characters to uppercase.
3. Determine the total length of the string and output it to the console.

ลองเขียนคำตอบด้วยตัวเองก่อน แล้วค่อยเทียบกับวิธีทำ

* เนื้อหาของ thinka สร้างโดย AI อาจไม่ถูกต้องสมบูรณ์ในทุกกรณี กรุณาใช้เป็นสื่อเสริมและตรวจสอบกับเอกสารอ้างอิงอย่างเป็นทางการ

คุณเห็นเฉลยแล้ว ทีนี้มาตรวจคำตอบของคุณบ้าง

หน้านี้บอกได้ว่าคำตอบที่ดีเป็นอย่างไร แต่บอกไม่ได้ว่าคำตอบของคุณขาดอะไร thinka ตรวจข้อเขียนของคุณตามเกณฑ์ให้คะแนนจริงในราว 15 วินาที

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

เริ่มฝึกเลย