Past-paper question · 2025 October-November · Paper 22 · Q8(b)

Question 8(b) 2025 · October-November · Paper 22 · 5 marks

Original past-paper question for 8(B)
Original past-paper question for 8(B)
Reveal official mark-scheme answer Official mark-scheme answer for 8(B)

Official answer for Question 8

Part (b)

✓
Example solution:

Question 7

✓
FUNCTION NewLoan(ThisStudentID, ThisBookID : STRING) __
✓
RETURNS
✓
BOOLEAN
✓
DECLARE Index : INTEGER
✓
DECLARE IsStored : BOOLEAN
✓
CONSTANT Blank = ""
✓
Index 1
✓
IsStored FALSE
✓
WHILE Index <= 7000 AND NOT
✓
IsStored
✓
IF Loan[Index].StudentID
✓
= Blank THEN
✓
ThisStudentID
✓
Loan[Index].StudentID
✓
Loan[Index].BookID
✓
ThisBookID
✓
Loan[Index].OnLoan
✓
TRUE
✓
IsStored TRUE
✓
ENDIF
✓
Index Index + 1
✓
ENDWHILE
✓
RETURN IsStored
✓
ENDFUNCTION
✓
Mark as follows:
✓
MP1
✓
Loop through 7000 elements in Loan array – correct loop structure
✓
MP2
✓
or until the first unused element is found // Correct RETURN inside a
✓
FOR loop
✓
MP3
✓
Correct use of the indexed dot notation
✓
MP4
✓
Test if record is unused (.StudentID = "")in a loop
✓
MP5
✓
Two item assignment statements correct
✓
MP6
✓
Loan[Index].OnLoan assigned TRUE
✓
MP7
✓
Correct logic to return BOOLEAN in both cases (position found / no
✓
position available)
✓
Alternative solution: loop only (no ‘found’ mechanism)
✓
FOR Index 1 TO 7000
✓
IF Loan[Index].StudentID
✓
= Blank THEN
✓
ThisStudentID
✓
Loan[Index].StudentID
✓
Loan[Index].BookID
✓
ThisBookID
✓
Loan[Index].OnLoan
✓
TRUE
✓
RETURN TRUE
✓
ENDIF
✓
NEXT
✓
RETURN FALSE
✓
9618/22
✓
Cambridge International AS & A Level – Mark Scheme
✓
October/November
✓
PUBLISHED
✓
2025
✓
Question
✓
Answer
✓
Marks

Mark scheme 9618_w25_ms_22.pdf →

Show text version of question

Question 8

Part (b)

Question 8

TRUE valid total score (one 3-point question and one 5-point question correct)

For example, a total score of 6 points is valid; the value of the array element at index value 6 is TRUE

Part (b)

The pseudocode represents an algorithm to set the appropriate elements of the array to TRUE

Complete the pseudocode:

DECLARE EasyQ, HardQ : INTEGER

FOR EasyQ ............................ TO 15 STEP ............................

FOR HardQ 0 TO ............................ STEP ............................

CheckTotal[.......................................................] TRUE

NEXT HardQ

NEXT EasyQ

[5]
Topic relevance

Why this question appears here

71% assigned-topic match · Algorithm design and problem-solving › Algorithms

Topic-match percentages estimate how closely each question fits the selected syllabus topic. They are a guide for choosing stricter or broader practice.

Permanent source page: Educate A Change · From 9618_w25_qp_22.pdf

Keep practising this topic