Past-paper question · 2015 October-November · Paper 23 · Q2(b)(iv)

Question 2(b)(iv) 2015 · October-November · Paper 23 · 6 marks

Original past-paper question for 2(B)(IV)
Original past-paper question for 2(B)(IV)
Original past-paper question for 2(B)(IV)
Original past-paper question for 2(B)(IV)
Original past-paper question for 2(B)(IV)
Reveal official mark-scheme answer Official mark-scheme answer for 2(B)(IV)Official mark-scheme answer for 2(B)(IV)

Official answer for Question 2

Part (b)

(iv)

(iv)

Second and third mark dependent on first mark.

✓
When and how interchangeable
✓
Type: – syntax error
✓
When: – during compilation of program // in IDE environment // running an interpreted
✓
program
✓
How: – reported by the translator diagnostics // highlights/stops at the statement with the
✓
syntax error // compiler/interpreter checks against syntax rules / rules of the language
✓
Type: – run-time error
✓
When: – during testing/execution
✓
How: – program will ‘crash’ e.g. attempted ‘divide by zero’ error
[6]
✓
Mark Scheme
✓
Syllabus
✓
Paper
✓
Cambridge International AS/A Level – October/November 2015
✓
9691

Question 23

Mark scheme 9691_w15_ms_23.pdf →

Show text version of question

Question 2

Part (b)

(iv)

Question 2

Alia received a number coded as a sequence of letters. She wants to write a program to change

this sequence of letters back to the original number. She knows that each digit of the original number was replaced by exactly one letter. The letters used are shown in the flowchart below.

She has drawn the flowchart as part of the design for her solution.

The function DenaryDigit(Letter) returns an integer.

FUNCTION DenaryDigit(Letter)

CASE OF 'K' Letter Value 0

ELSE 'D' Value 1

'L' Value 2

'C' Value 3

Value –1 'F' Value 4

'H' Value 5

'B' Value 6

'G' Value 7

'E' Value 8

'A' Value 9

RETURN Value

ENDFUNCTION

Question 7

Alia writes pseudocode to convert a coded number using

  • the function DenaryDigit() from part

Part (a)

  • the string manipulation functions MID() and LENGTH()

Study the pseudocode:

01 PROCEDURE ConvertToDenary(CodedNumber : STRING) 02 03 Denary ← 0 04 05 FOR i ← 1 TO LENGTH(CodedNumber) 06 ThisChar ← MID(CodedNumber, i, 1) 07 ThisNumber ← DenaryDigit(ThisChar) 08 Denary ← Denary + (ThisNumber * 10) 09 ENDFOR

Question 10

11 OUTPUT Denary 12 ENDPROCEDURE

(iv)

There are two other types of error that can occur when writing or executing program

code.

Name each type of error and describe when and how it is detected.

Error type 1 .......................................................................................................................

When .................................................................................................................................

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

How ...................................................................................................................................

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

Error type 2 .......................................................................................................................

When .................................................................................................................................

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

How ...................................................................................................................................

.......................................................................................................................................[6]

Topic relevance

Why this question appears here

80% 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_w15_qp_23.pdf

Keep practising this topic