Programming: past paper questions
Real questions on programming
The newest 20 of 283 written questions. Open one to see it on the real paper.
- 9618/13 · October/November 2025 · Q8b[3]
Explain how a programmer benefits from using program libraries during program development.
See it on the paper → - 9618/21 · October/November 2025 · Q5a(i)[1]
Comment on why the programmer chose –1 as the initial value of FoundAt
See it on the paper → - 9618/21 · October/November 2025 · Q8a[7]
Write efficient pseudocode for the module OKToBorrow()
See it on the paper → - 9618/21 · October/November 2025 · Q8b[8]
A second module is defined: Module Description • ReturnBook() • • • called with two parameters of type STRING representing a StudentID and a BookID searches the array for the relevant loan record when found, sets OnLoan to FALSE and returns TRUE if a loan record is not found, or the book has already been returned, then...
See it on the paper → - 9618/22 · October/November 2025 · Q1a[4]
The table contains pseudocode examples. Each example may contain statements that relate to one or more of: • • • selection iteration (repetition) subroutines (procedures or functions). Pseudocode example Selection Iteration Complete the table by placing one or more ticks (‘3’) in each row. Subroutine IF Status = FALSE...
See it on the paper → - 9618/22 · October/November 2025 · Q4a[4]
All variables used must be declared. (a) Write pseudocode to declare CheckTotal and to set all elements of the array to FALSE
See it on the paper → - 9618/22 · October/November 2025 · Q4b[5]
The pseudocode represents an algorithm to set the appropriate elements of the array to TRUE Complete the pseudocode: DECLARE EasyQ, HardQ : INTEGER TO 15 STEP FOR EasyQ FOR HardQ 0 TO STEP CheckTotal[ ] TRUE NEXT HardQ
See it on the paper → - 9618/22 · October/November 2025 · Q6[7]
A string function Compare() will compare two strings. The function will: take four parameters: ○ two strings, String1 and String2 ○ a character, Position, to indicate whether String1 will be compared with the start ('s'), or the end ('e') of String2 ○ a Boolean, CaseMatters, to indicate whether an upper case character...
See it on the paper → - 9618/23 · October/November 2025 · Q1b(i)[2]
State two reasons why the programmer may decide to use a subroutine.
See it on the paper → - 9618/23 · October/November 2025 · Q1b(ii)[2]
A function header in pseudocode is defined as: FUNCTION Pass2(Count : INTEGER) RETURNS BOOLEAN Complete the table by describing the terms used in the function header. The first row has been completed. Term Description Pass2 the name of the function Count BOOLEAN (ii)
See it on the paper → - 9618/23 · October/November 2025 · Q2b[2]
Iteration is one programming construct. Identify one other programming construct that will be required when the algorithm from part (a) is converted into pseudocode and explain how it is used. Construct Use
See it on the paper → - 9618/23 · October/November 2025 · Q3[1]
The array is declared in pseudocode: DECLARE ThisStack : ARRAY[1:30] OF INTEGER Stack design notes: The global variable SP acts as a stack pointer. SP contains the array index of the last value pushed onto the stack. • If the stack is empty, then SP is assigned the value zero. • The first item added to the stack will b...
See it on the paper → - 9618/23 · October/November 2025 · Q5a[4]
Complete the trace table by dry running the procedure when it is called in the statement: CALL Process(1) Index CaseVar Count Num Num Num Num
See it on the paper → - 9618/23 · October/November 2025 · Q5b(i)[1]
Identify the CaseVar values for these two existing clauses. (i)
See it on the paper → - 9618/23 · October/November 2025 · Q5b(ii)[2]
Write pseudocode for a single clause to replace the two clauses identified in (b) (i).
See it on the paper → - 9618/23 · October/November 2025 · Q6b[7]
A function CheckNumber() will take an integer value and return the Boolean value TRUE if the check digit is correct, otherwise return FALSE Write pseudocode for the function CheckNumber() Assume that the parameter is valid.
See it on the paper → - 9618/31 · October/November 2025 · Q1b(ii)[1]
Write the new pseudocode statement required to update the declaration of Choice in the definition of ClubMember.
See it on the paper → - 9618/31 · October/November 2025 · Q10[3]
Explain what is meant by exception handling. Include an example of a possible cause of an exception in your answer. Explanation
See it on the paper → - 9618/32 · October/November 2025 · Q12a(ii)[2]
Write pseudocode to input a new data item and add it to the stack using Push().
See it on the paper → - 9618/33 · October/November 2025 · Q12b[2]
Identify one example of an exception and give one reason why the exception may cause a problem. Example Reason
See it on the paper →
What examiners said
This question asked for the advantages of using an interpreter rather than using a compiler. Many of the responses simply described the operation of an interpreter without any comparison to a compiler. Candidates should understand that in questions like this, it is necessary include both translators in the answer.
— Examiner report, October/November 2023, 9618/11 Q6(a) (Cambridge)
This question was generally not answered well. Many candidates need to improve their understanding of why some high-level languages are partially compiled and partially interpreted.
— Examiner report, October/November 2023, 9618/11 Q6(b) (Cambridge)
This question was generally answered well. The most popular correct answers were colour coding and the ability to expand/collapse code blocks. The question asked for features to support the visual presentation. A significant number of responses included features of an IDE which were not presentation features.
— Examiner report, October/November 2023, 9618/11 Q6(c)(i) (Cambridge)
Past papers, syllabus and examiner reports © UCLES (Cambridge University Press & Assessment). Questions are matched to topics from the official syllabus. AssessPro is independent and not endorsed by Cambridge.