Past-paper question · 2018 May-June · Paper 21 · Q3

Question 3 2018 · May-June · Paper 21 · 8 marks

Original past-paper question for 3
Original past-paper question for 3
Reveal official mark-scheme answer Official mark-scheme answer for 3Official mark-scheme answer for 3

Official answer for Question 3

Question 8

✓
One mark for:

Question 1

✓
STAR
✓
RT and END
✓
D / STOP

Question 2

✓
promp
✓
pt and input t of Sensor
✓
rID (allow alt
✓
a name)

Question 3

✓
decisi on box che cking that S
✓
SensorID is
✓
i between 1 & 10

Question 4

✓
calling
✓
g GetTemp with Senso
✓
orID as pa rameter

Question 5

✓
decisi on box com
✓
mparing Tem
✓
mp > HighT
✓
Temp

Question 6

✓
calling
✓
g Alarm()

Question 7

✓
decisi on box com
✓
mparing Tem
✓
mp < LowTe
✓
emp

Question 8

✓
both output
✓
o
✓
mess
✓
sages
✓
9608/21

Question 9

✓
Cambridg
✓
ge Internatio
✓
onal AS/A Level
✓
L
  • Mar k Scheme
✓
Ma
✓
ay/June 201

Question 18

✓
P
✓
PUBLISHED
✓
D
✓
Question
✓
Q
✓
Answer r
✓
Mark
✓
ks

Mark scheme 9608_s18_ms_21.pdf →

Show text version of question

Question 3

In a chemical factory, a procedure, CheckSensor() is required to allow an operator to monitor the temperature in different locations.

In the factory:

  • the temperature is measured by 10 sensors, each at a different location
  • each sensor has a unique ID (1 to 10).

The procedure CheckSensor() will compare the measured temperature against each of two constant values, LowTemp and HighTemp. It will perform the following actions depending on the result of the comparison.

Measured temperature Action below LowTemp Output "Cold" from LowTemp to HighTemp Output "Normal" above HighTemp Call procedure Alarm()

A
library function, GetTemp(), returns the temperature value from a given sensor.

The structured English representing the algorithm for the procedure CheckSensor() is as follows:

1. Prompt for the input of a sensor ID. 2. Input a sensor ID. 3. If the sensor ID is invalid, repeat from step 1. 4. Call the GetTemp() function with the sensor ID as the parameter, to obtain the relevant temperature. 5. Compare the temperature against the two constant values and take the appropriate action.

Draw a program flowchart on the next page to represent the algorithm for procedure CheckSensor().

Variable declarations are not required in program flowcharts.

Question 7

[8]

Question 8

Topic relevance

Why this question appears here

91% assigned-topic match · Programming › Programming basics

Topic-match percentages estimate how closely each question fits the selected syllabus topic. They are a guide for choosing stricter or broader practice.

Permanent source page: Educate A Change · From 9608_s18_qp_21.pdf

Keep practising this topic