Cambridge International A Level · Computer Science (9618)

Further Programming: Practice Questions

5 multiple-choice questions marked as you go, and 5 written questions with worked solutions. All on Further Programming.

10 questions27 marksFree, no account
Question 1
1 mark

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?

Question 2
1 mark

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 \)?

Question 3
1 mark

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?

Question 4
1 mark

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).?

Question 5
1 mark

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

Question 6
4 marks

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

Write your answer out first, then check it against the worked solution.

Question 7
5 marks

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

Write your answer out first, then check it against the worked solution.

Question 8
3 marks

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

Write your answer out first, then check it against the worked solution.

Question 9
4 marks

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.

Write your answer out first, then check it against the worked solution.

Question 10
6 marks

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.

Write your answer out first, then check it against the worked solution.

* The content provided by thinka is generated by AI and may not always be accurate or up-to-date. Please use it as a supplementary resource and verify with official materials.

You've seen the model answer. Now get yours marked.

This page can show you how a good answer looks. It cannot tell you what your answer was missing. thinka marks your written work against the real mark scheme in about 15 seconds.

Want more questions like these? Get a fresh set on this topic, marked as you go.

Practise More