Past-paper question · 2025 October-November · Paper 42 · Q2(b)

Question 2(b) 2025 · October-November · Paper 42 · 3 marks

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

Official answer for Question 2

Part (b)

Question 1

mark each

Question 3

  • Procedure header (and close) taking (array) as parameter
  • Outputting array contents once …
  • … on one line with a space between each integer
✓
Example program code
✓
Java
✓
public static void PrintArray(Integer[] DataArray){
✓
String Output = "";
✓
for(Integer X = 0; X < 20; X++){
✓
Output += Integer.toString(DataArray[X]) + " ";
✓
}
✓
System.out.println(Output);
✓
}
✓
VB.NET
✓
Sub PrintArray(DataArray() As Integer)
✓
Dim Output As String = ""
✓
For X = 0 To 19
✓
Output = Output + Str(DataArray(X)) + " "
✓
Next X
✓
Console.WriteLine(Output)
✓
End Sub
✓
Python
✓
def PrintArray(DataArray):
✓
Output = ""
✓
for Item in DataArray:
✓
Output = Output + str(Item) + " "
✓
print(Output)
✓
9618/42
✓
Cambridge International AS & A Level – Mark Scheme
✓
October/November 2025
✓
PUBLISHED
✓
Question
✓
Answer
✓
Marks

Mark scheme 9618_w25_ms_42.pdf →

Show text version of question

Question 2

Part (b)

Question 2

A program stores 20 unique random integers between 0 and 100 (inclusive) in a 1D array that is

local to the main program.

Part (b)

The procedure PrintArray() takes an integer array as a parameter. The procedure outputs

the array contents on a single line with a space between each integer.

Write the program code for PrintArray()

Save your program.

Copy and paste the program code into part 2(b) in the evidence document.

[3]
Topic relevance

Why this question appears here

71% assigned-topic match · Programming › Structured programming

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_42.pdf

Keep practising this topic