Past-paper question · 2024 October-November · Paper 22 · Q5(c)

Question 5(c) 2024 · October-November · Paper 22 · 2 marks

Original past-paper question for 5(C)
Original past-paper question for 5(C)
Original past-paper question for 5(C)
Original past-paper question for 5(C)
Reveal official mark-scheme answer Official mark-scheme answer for 5(C)

Official answer for Question 5

Part (c)

✓
Example solution:

Question 2

✓
IF Index Mod 2 = 0 THEN
✓
ReturnValue TO_UPPER(RIGHT(Label, Count))
✓
ELSE
✓
ReturnValue " **** "
✓
ENDIF
✓
Mark as follows:
✓
MP1 IF...THEN...ELSE...ENDIF
✓
MP2 Both correct assignments and the correct test/logic
✓
Cambridge International AS & A Level – Mark Scheme
✓
9618/22
✓
October/November
✓
PUBLISHED
✓
2024
✓
Question
✓
Answer
✓
Marks

Mark scheme 9618_w24_ms_22.pdf →

Show text version of question

Question 5

Part (c)

Question 5

A program contains a global 1D array Data with 100 elements of type INTEGER.

The program contains a function Process() expressed in pseudocode as follows:

FUNCTION Process(Number : INTEGER, Label : STRING) RETURNS STRING DECLARE Index, Count : INTEGER DECLARE ReturnValue : STRING

Count INT(100 / Number) Index Data[Number]

CASE OF (Index MOD 2) 0 : ReturnValue TO_UPPER(RIGHT(Label, Count)) 1 : ReturnValue "****" ENDCASE

RETURN RetVal ENDFUNCTION

Part (c)

The function Process() contains a selection construct using a CASE structure.

Write pseudocode using a single selection construct with the same functionality without using a CASE structure.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

.............................................................................................................................................

[2]

Question 12

, ,

Topic relevance

Why this question appears here

71% assigned-topic match · Programming › Constructs

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

Keep practising this topic