Question 1
1 markWhich one of the following values has the real data type?
Choose your answer.
- 15
- '15.0'
- 15.0
- 'fifteen'
Model answer
15.0
Explanation
15.0 is a number written with a fractional part, so it is a real, even though the fractional part is zero. 15 is an integer, and '15.0' and 'fifteen' are strings because they are in quotation marks. The common mistake is to choose '15.0' without noticing the quotation marks.
Mark scheme
-
1 mark
15.0
Mark is for AO1 (understanding). If more than one option is given, 0 marks.