18Easy
0/1

An algorithm is designed to control a smart garden sprinkler system based on the current season.

1      season ← USERINPUT
2      IF season = 'summer' THEN
3          cycles ← 3
4      ELSE IF season = 'spring' OR season = 'autumn' THEN
5          cycles ← 2
6      ELSE IF season = 'winter' THEN
7          cycles ← 0
8      ELSE
9          OUTPUT 'Season not recognised'
10     ENDIF
11     FOR i ← 1 TO cycles
12         IF i < 3 THEN
13             ACTIVATE_SPRINKLER('mist')
14         ELSE
15             ACTIVATE_SPRINKLER('heavy')
16         ENDIF
17     ENDFOR

Which option shows the data type of the variable season in this algorithm?

Real

String

Integer

Boolean

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