Past-paper question · 2025 May-June · Paper 43 · Q2(c)

Question 2(c) 2025 · May-June · Paper 43 · 2 marks

Question 2

Part (c)

Question 2

A program sorts the data in the 1D array DataArray and searches DataArray for specific

values.

DataArray stores 14 integer values and is declared local to the main program.

Part (c)

The procedure OutputArray() takes an array of integers as a parameter. The procedure

outputs each element in the array from the first element to the last element. The output is on one line with a space between each number.

An example output is:

Write program code for OutputArray()

Save your program.

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

[2]

Question 5

Reveal official mark-scheme answer Official mark-scheme answer for 2(C)Official mark-scheme answer for 2(C)

Official answer for Question 2

Part (c)

Question 1

mark each

Question 2

  • OutputArray() header (and close) taking an array parameter and outputting the array contents …
  • … in correct format
✓
9618/43
✓
Cambridge International AS & A Level – Mark Scheme
✓
May/June 2025
✓
PUBLISHED
✓
Question
✓
Answer
✓
Marks
✓
Example program code:
✓
Python
✓
def OutputArray(DataArray):
✓
Output = ""
✓
for Item in DataArray:
✓
Output = Output + str(Item) + " "
✓
print(Output)
✓
Java
✓
public static void OutputArray(Integer[] DataArray){
✓
String Output = "";
✓
Integer X = 0;
✓
while(X < DataArray.length){
✓
if(DataArray[X] != -1){
✓
Output = Output + DataArray[X] + " ";
✓
}
✓
X = X + 1;
✓
}
✓
System.out.println(Output);
✓
}
✓
VB.NET
✓
Sub OutputArray(DataArray)
✓
Dim Output As String = ""
✓
Dim X As Integer = 0
✓
While X < DataArray.length
✓
If DataArray(X) <> -1 Then
✓
Output = Output & DataArray(X) & " "
✓
End If
✓
X = X + 1
✓
End While
✓
Console.WriteLine(Output)
✓
End Sub
✓
9618/43
✓
Cambridge International AS & A Level – Mark Scheme
✓
May/June 2025
✓
PUBLISHED
✓
Question
✓
Answer
✓
Marks

Mark scheme 9618_s25_ms_43.pdf →

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

Keep practising this topic