Past-paper question · 2023 May-June · Paper 41 · Q1(b)(i)

Question 1(b)(i) 2023 · May-June · Paper 41 · 3 marks

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

Official answer for Question 1

Part (b)

(i)

Question 1

mark each

Question 3

✓
Procedure header (and close where appropriate) with (at least) one (integer array) parameter
✓
Outputting all (25) array elements …
✓
…on one line
✓
Example program code:
✓
Java
✓
public static void PrintArray(Integer[] DataArray){
✓
String OutputData;
✓
for(Integer X = 0; X < DataArray.length - 1; X++){
✓
OutputData = OutputData + DataArray[X] + " ";
✓
}
✓
System.out.print(OutputData);
✓
}
✓
VB.NET
✓
Sub PrintArray(DataArray)
✓
Dim OutputData As String = "";
✓
For x = 0 To DataArray.length - 1
✓
OutputData = OutputData & DataArray(x) & " "
✓
Next
✓
Console.WriteLine(OutputData)
✓
End Sub
✓
Python
✓
def PrintArray(DataArray):
✓
output = ""
✓
for X in range(0, len(DataArray)):
✓
output = output + str((DataArray[X])) + " "
✓
print(output)
✓
9618/41
✓
Cambridge International AS & A Level – Mark Scheme
✓
May/June 2023
✓
PUBLISHED
✓
Question
✓
Answer
✓
Marks

Mark scheme 9618_s23_ms_41.pdf →

Show text version of question

Question 1

Part (b)

(i)

Question 1

A program reads data from a file and searches for specific data.

(i)

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

contents of the array in the order they are stored.

The items are printed on the same line, for example:

10 4 5 13 25

Write program code for the procedure PrintArray()

Save your program.

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

[3]

Question 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_s23_qp_41.pdf

Keep practising this topic