Past-paper question · 2019 May-June · Paper 23 · Q1(a)

Question 1(a) 2019 · May-June · Paper 23 · 7 marks

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

Official answer for Question 1

Part (a)

Question 6

✓
Mark as follows:
✓
•
✓
One mark per area outlined, in correct place
✓
•
✓
Decision must be diamond symbol and have two outputs with at least one
✓
label (YES / NO)
✓
9608/23
✓
Cambridge International AS/A Level – Mark Scheme
✓
May/June 2019
✓
PUBLISHED
✓
Question
✓
Answer
✓
Marks

Mark scheme 9608_s19_ms_23.pdf →

Show text version of question

Question 1

Part (a)

Question 1

The following pseudocode searches for the longest run of identical characters in the array

Message.

DECLARE Message : ARRAY[1:100] OF CHAR

PROCEDURE Search()

DECLARE Index : INTEGER DECLARE ThisChar : CHAR DECLARE ThisRun : INTEGER DECLARE LongRun : INTEGER

ThisChar Message[1] ThisRun 1 LongRun 1

FOR Index 2 TO 100

IF Message[Index] = ThisChar THEN ThisRun ThisRun + 1 ELSE ThisChar Message[Index] IF ThisRun > LongRun THEN LongRun ThisRun ENDIF ThisRun 1 ENDIF

ENDFOR

OUTPUT "The longest run was " , LongRun

ENDPROCEDURE

Question 3

Part (a)

Draw a program flowchart to represent the procedure Search().

Variable and array declarations are not required in program flowcharts.

[6]

Question 4

Topic relevance

Why this question appears here

71% assigned-topic match · Hardware › Logic gates and logic circuits

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

Keep practising this topic