Question 4(a) 2017 · October-November · Paper 21 · 2 marks
Reveal official mark-scheme answer
Official answer for Question 4
Part (a)
Question 2
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
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
