Past-paper question · 2017 October-November · Paper 21 · Q4(b)

Question 4(b) 2017 · October-November · Paper 21 · 3 marks

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

Official answer for Question 4

Part (b)

Question 3

✓
Value
✓
Required output
✓
Mask
✓
1234.00
✓
"1,234.00"
✓
"0,000.00"
✓
3445.66
✓
"£3,445.66"
✓
"£0,000.00"
✓
10345.56
✓
"$□ □10,345"
✓
"$##00,000"
✓
Currency and ‘punctuation’ symbols must be as shown
✓
9608/21
✓
Cambridge International AS/A Level – Mark Scheme
✓
October/November
✓
PUBLISHED
✓
2017
✓
Question
✓
Answer
✓
Marks

Mark scheme 9608_w17_ms_21.pdf →

Show text version of question

Question 4

Part (b)

Question 4

Numeric formatting converts a numeric value to a string in order to present it in a specific way.

In a generic high-level language, formatting is implemented using a mask system. In this system, each character of the mask corresponds to one character of the formatted string.

Mask characters have the following meaning:

Mask character Meaning # Character must be a digit or a space 0 Character must be a digit

Any other mask characters are taken as literal values and are included in the formatted string.

Part (b)

For each row in the following table, define the mask required to produce the formatted output

from the given value. □ represents a space.

Value Required output Mask

[3]

Question 12

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

Keep practising this topic