Past-paper question · 2015 October-November · Paper 22 · Q7(a)

Question 7(a) 2015 · October-November · Paper 22 · 4 marks

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

Official answer for Question 7

Part (a)

✓
A replacement character is ‘calculated’ from its ASCII value // or by example …
[1]

Mark scheme 9608_w15_ms_22.pdf →

Show text version of question

Question 7

Part (a)

Question 7

ASCII character codes are used to represent a single character.

Part of the code table is shown below.

ASCII code table (part) Character Decimal Character Decimal Character Decimal <Space> 32 I 73 R 82

A
65 J 74 S 83
B
66 K 75 T 84
C
67 L 76 U 85
D
68 M 77 V 86

E 69 N 78 W 87 F 70 O 79 X 88 G 71 P 80 Y 89 H 72 Q 81 Z 90

Some pseudocode statements follow which use these built-in functions:

CHARACTERCOUNT(ThisString : STRING) RETURNS INTEGER returns the number of characters in the string ThisString. For example: CHARACTERCOUNT("South Africa") returns 12.

CHR(ThisInteger : INTEGER) RETURNS CHAR returns the character with ASCII value ThisInteger. For example: CHR(66) returns 'B'.

ASC(ThisCharacter : CHAR) RETURNS INTEGER returns the ASCII value for character ThisCharacter. For example: ASC('B') returns 66.

Part (a)

Give the values assigned to the variables A, B, C and D.

The & operator is used to concatenate two strings.

The expression could generate an error; if so, write ERROR.

Num1 ← 5

A
← ASC('F') + Num1 + ASC('Z')

(i)

A .....................................................

[1]
B
← CHR(89) & CHR(69) & CHR(83)

(ii)

B .....................................................

[1]
C
← CHARACTERCOUNT(B & "PLEASE")

(iii)

C .....................................................

[1]
D
← ASC(ONECHAR("CURRY SAUCE", 7))

(iv)

D .....................................................

[1]

Question 16

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

Keep practising this topic