Question 3 2018 · May-June · Paper 21 · 8 marks
Reveal official mark-scheme answer

Official answer for Question 3
Question 8
Question 1
Question 2
Question 3
Question 4
Question 5
Question 6
Question 7
Question 8
Question 9
- Mar k Scheme
Question 18
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()
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
Question 8
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
