Difficulty: Medium
Correct Answer: 1 and 2 only
Explanation:
Introduction:
This question examines Pascal's file model, especially how typed and text files are viewed conceptually. It differentiates core language properties from implementation-specific extensions like random access on typed files in some compilers.
Given Data / Assumptions:
Concept / Approach:
In standard Pascal, files are sequences of elements (typed files: 'file of T') or characters/lines (text files). They are homogeneous (all components same type). File length may change with writing/appending. Although many practical implementations permit Seek for typed files, the standard conceptual model emphasizes sequential processing. Therefore, statements (1) and (2) are universally correct, while (3) is not strictly true across implementations and use-cases.
Step-by-Step Solution:
Verification / Alternative check:
Check language references: conceptual definition emphasizes sequence and homogeneity; random access is compiler/RTL dependent, not guaranteed by the pure standard.
Why Other Options Are Wrong:
'All' – overstates (3). '2 and 3 only' – includes (3) incorrectly. '1 and 3 only' – includes (3) incorrectly.
Common Pitfalls:
Assuming Turbo Pascal capabilities are universal; conflating text-file sequential constraints with typed-file possibilities.
Final Answer:
1 and 2 only
Discussion & Comments