Past-paper question · 2018 May-June · Paper 21 · Q2(a)(ii)

Question 2(a)(ii) 2018 · May-June · Paper 21 · 1 mark

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

Official answer for Question 2

Part (a)

(ii)

✓
•
✓
Comments

Question 1

✓
9608/21
✓
Cambridge International AS/A Level – Mark Scheme
✓
May/June 2018
✓
PUBLISHED
✓
Question
✓
Answer
✓
Marks

Mark scheme 9608_s18_ms_21.pdf →

Show text version of question

Question 2

Part (a)

(ii)

Question 2

The following is a function design in pseudocode.

Line numbers are given for reference only.

01 FUNCTION StringClean(InString : STRING) RETURNS STRING 02 03 DECLARE NextChar : CHAR 04 DECLARE OutString : STRING 05 DECLARE Counter : INTEGER 06 DECLARE MyString : STRING 07 08 OutString "" 09 10 FOR Counter 1 TO LENGTH(InString)

Question 11

12 NextChar MID(InString,Counter,1) 13 NextChar LCASE(NextChar)

Question 14

15 IF (NextChar >= 'a') AND (NextChar <= 'z')

Question 16

17 THEN

Question 18

19 OutString OutString & NextChar

Question 20

21 ENDIF

Question 22

23 ENDFOR

Question 24

25 RETURN OutString

Question 26

27 ENDFUNCTION

(ii)

State one feature that could be added to make the pseudocode easier to understand.

.......................................................................................................................................[1]

Question 5

Topic relevance

Why this question appears here

82% assigned-topic match · Data types and structures › Data types and records

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 9608_s18_qp_21.pdf

Keep practising this topic