Past-paper question · 2013 October-November · Paper 32 · Q5(a)

Question 5(a) 2013 · October-November · Paper 32 · 7 marks

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

Official answer for Question 5

Part (a)

Part (a)

Boolean

[1]
✓
Flags when the input name is found
[1]
✓
//Serial search algorithm
✓
INPUT SearchName
[1]
✓
IsFound FALSE
✓
Index 1
✓
REPEAT
✓
IF Customer[Index] = SearchName
[1]
✓
THEN
✓
IsFound TRUE
✓
OUTPUT “FOUND” at position Index
✓
ELSE
✓
Index Index + 1
[1]
✓
ENDIF
✓
UNTIL (IsFound = TRUE) OR Index=101 / >100
[1]
✓
IF IsFound = FALSE // Index = 101/>100
[1]
✓
THEN
✓
OUTPUT “Customer name was NOT FOUND”
✓
ENDIF

Mark scheme 9691_w13_ms_32.pdf →

Show text version of question

Question 5

Part (a)

Question 5

Customer names are stored in the array Customer. For

Examiner's Use An algorithm is to be designed to perform a serial search of the array for a requested customer name.

The algorithm will use the variables shown in the table.

Part (a)

Study the table and the algorithm and fill in the gaps.

Identifier Data Type Description Customer ARRAY[100] OF STRING Array of customer names

Index INTEGER Used to index the array elements

IsFound

SearchName STRING The requested customer name

Question 13

//Serial search algorithm For Examiner's Use INPUT

IsFound ← FALSE

Index ← 1

REPEAT

IF = SearchName

THEN

IsFound ← TRUE

OUTPUT "Found at position " Index

ELSE

ENDIF

UNTIL (IsFound = TRUE) OR

IF

THEN

OUTPUT "Customer name was NOT FOUND"

ENDIF

[7]
Topic relevance

Why this question appears here

72% 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 9691_w13_qp_32.pdf

Keep practising this topic