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

Question 4(a) 2017 · October-November · Paper 21 · 2 marks

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

Official answer for Question 4

Part (a)

Question 2

✓
Value
✓
Formatted String
✓
1327.5
✓
"□ 1327.50"
✓
1234
✓
"□ 1234.00"
✓
7.456
✓
"□ □ □ 07.45"
✓
Leading spaces must be present

Mark scheme 9608_w17_ms_21.pdf →

Show text version of question

Question 4

Part (a)

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 (a)

Using the mask "###00.00", complete the following table. Use □ to represent a space. The

first value has been done for you.

Value Formatted string 1327.5 "□1327.50" 1234 7.456

[2]
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