Skip to content

Course home

Data types

Data types

Easy
1234567891011121314151617181920212223242526
Question 13

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.

A

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

B

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

C

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

D

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

Markscheme

Data types Questions

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

26 exam-style questions on OCR GCSE Computer Science Data types. Each one has a worked solution and a mark scheme showing where the marks go.

Question bank