Cambridge International A Level · Computer Science (9618)

Further Programming: แบบฝึกหัด

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

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

Which Object-Oriented Programming (OOP) principle refers to the bundling of data (attributes) and methods (functions) that operate on the data into a single unit, and restricting direct access to some of the object's components?

ข้อ 2
1 คะแนน

A random-access file consists of a fixed-length header of \( 512 \) bytes, followed by sequential records of \( 64 \) bytes each. If the first record is designated as Record 0, what is the starting byte offset for Record \( k \)?

ข้อ 3
1 คะแนน

In file processing, why is a random-access file generally more efficient than a sequential file for applications requiring frequent updates to specific customer records?

ข้อ 4
1 คะแนน

A declarative programming language contains the following facts and rules:
prereq(cs101, cs102).
prereq(cs102, cs103).
path(X, Y) :- prereq(X, Y).
path(X, Y) :- prereq(X, Z), path(Z, Y).
Which set of results for \( A \) satisfies the goal ?- path(cs101, A).?

ข้อ 5
1 คะแนน

In Object-Oriented Programming, what is the primary role of encapsulation regarding the internal state of an object?

ข้อ 6
4 คะแนน

In a declarative programming language, how does a rule differ from a fact?

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

ข้อ 7
5 คะแนน

When performing file operations, explain the specific purpose of opening a file in APPEND mode compared to WRITE mode.

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

ข้อ 8
3 คะแนน

Explain why exception handling is preferred over using standard selection statements (like IF...ELSE) for managing runtime errors in complex applications.

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

ข้อ 9
4 คะแนน

A programmer is developing a system that logs user activities to a text file. They are choosing between WRITE mode and APPEND mode.

(a) Describe the difference in behavior regarding the file pointer when a file is opened in these two modes.

(b) Explain one potential risk of using WRITE mode in a logging system and how exception handling could be used to make the file-opening process more robust.

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

ข้อ 10
6 คะแนน

A program is designed to read data from a random-access file. The program must handle two specific potential issues: the file not existing, and the user requesting a record index that is out of bounds.

(a) Write pseudocode using a nested TRY...CATCH structure or multiple CATCH blocks to handle these two errors separately with specific error messages.

(b) Justify the use of exception handling instead of standard IF statements for managing hardware-related errors (like a disk failure) during file processing.

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

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

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

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

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

เริ่มฝึกเลย