State the most suitable data type for the variables waterTemperature and systemLog used in the algorithm below.
stationID ← USERINPUT
waterTemperature ← 18.5
systemLog ← "Normal operation"
criticalAlert ← "CRITICAL TEMPERATURE WARNING"
waterTemperature ← USERINPUT
IF waterTemperature > 30.0 THEN
systemLog ← criticalAlert
OUTPUT systemLog
ELSE
IF waterTemperature < 5.0 THEN
systemLog ← "Low temperature warning"
OUTPUT systemLog
ELSE
OUTPUT systemLog
ENDIF
ENDIF
| Variable identifier | Data type |
|---|---|
waterTemperature | |
systemLog |
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.