19Easy
0/2

The subroutine CheckAcceleration is used in a self-driving vehicle's stability control system. The variable lateral_accel represents the lateral acceleration in m/s2\text{m/s}^2m/s2 and can store values such as −2.5-2.5−2.5, 0.00.00.0, or 1.851.851.85.

SUBROUTINE CheckAcceleration(lateral_accel)
  IF lateral_accel < -1.5 OR lateral_accel > 1.5 THEN
    RETURN 'W'
  ELSE
    RETURN 'S'
  ENDIF
ENDSUBROUTINE

State the most appropriate data type for each of these sets of values.

ValuesData type
−2.5,0.0,1.85-2.5, 0.0, 1.85−2.5,0.0,1.85
'W', 'S'
[2]

Data types Questions

Practise AQA GCSE Computer Science Data types with exam-style questions for GCSE Computer Science. 50 questions, matched to the AQA GCSE Computer Science (8525) specification and written in Paper 1 and Paper 2 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