An algorithm designed to monitor a temperature sensor is shown below.
1 temp_celsius ← 24.5
2 threshold ← USERINPUT
3 critical_limit ← threshold * 1.5 - 2.0
4 is_active ← TRUE
5 IF temp_celsius >= critical_limit AND is_active THEN
6 OUTPUT "Warning"
7 ELSEIF critical_limit != 0.0 OR temp_celsius == 0.0 THEN
8 OUTPUT "System check"
9 ENDIF
On which line is a relational operator first used?
Line 3
Line 4
Line 5
Line 7
Practise AQA GCSE Computer Science Relational operations in a programming language with exam-style questions for GCSE Computer Science. 11 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.