Skip to content

Course home

Data types

Data types

Easy
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
Question 18

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?

A

Real

B

String

C

Integer

D

Boolean

Markscheme

Data types Questions

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

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

Question bank