24Easy
0/2

The subroutine in Figure 1 uses the values 'D' and 'S'. The variable dive_depth can store the values -150.5, 0.0, or 325.75.

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

ValuesData type
'D', 'S'
-150.5, 0.0, 325.75

Figure 1

SUBROUTINE CategoriseDepth(dive_depth)
  IF dive_depth > 100.0 THEN
    RETURN 'D'
  ELSE
    RETURN 'S'
  ENDIF
ENDSUBROUTINE
[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