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
11 exam-style questions on AQA GCSE Computer Science Relational operations in a programming language. Each one has a worked solution and a mark scheme showing where the marks go.