Data types
13
0/1

An industrial IoT sensor measures the electrical current flowing through a smart-grid node every millisecond. The measurements can be positive or negative and are recorded to three decimal places (for example, -14.802 A or 5.150 A).

Select the option that identifies the most appropriate primitive data type to store an individual current reading and provides the correct justification.

IntegerIntegerInteger, because the current is sampled at discrete millisecond intervals, meaning each measurement represents a distinct, countable value.

StringStringString, because it is the only primitive type that can preserve both the negative sign and the decimal point character without numerical drift.

RealRealReal (or Float), because the measurements are continuous physical quantities with fractional parts, requiring a data type that supports floating-point representation.

BooleanBooleanBoolean, because the sensor only needs to record whether the current is flowing in the positive direction (true) or negative direction (false).

Data types Questions

Practise OCR GCSE Computer Science Data types with exam-style questions for GCSE Computer Science. 26 questions, matched to the OCR GCSE Computer Science (J277) specification and written in Component 01 and Component 02 style. Every question includes a full worked solution and mark scheme, so you can see where marks are awarded rather than just whether you got the answer right.

PreviousNext

Data types Questions

  1. GCSE
  2. /Computer Science
  3. /Data types