Skip to content

Course home

Relational operations in a programming language

Relational operations in a programming language

Easy
1234567891011
Question 7

An algorithm designed to calibrate and validate telemetry data from a meteorological sensor is shown below:

1  sensor_reading ← USERINPUT
2  calibration_constant ← 1.45
3  adjusted_value ← sensor_reading * calibration_constant + 0.5
4  status_valid ← TRUE
5  IF adjusted_value != 0.0 AND NOT status_valid THEN
6      OUTPUT "Error"
7  ELSEIF adjusted_value >= 100.0 OR adjusted_value < -10.0 THEN
8      OUTPUT "Out of bounds"
9  ELSE
10     OUTPUT "Normal"
11 ENDIF

On which line is a relational operator first used?

A

Line 3

B

Line 5

C

Line 4

D

Line 7

Markscheme

Relational operations in a programming language Questions

  1. GCSE
  2. /Computer Science
  3. /Relational operations in a programming language

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.

Question bank