Question 4 2018 · May-June · Paper 23 · 10 marks
Reveal official mark-scheme answer
Official answer for Question 4
Question 9
Question 1
Question 2
Question 3
Question 4
Question 5
Question 6
Question 7
Question 8
Question 9
Question 8
Question 9
Show text version of question
Question 4
The temperature is monitored as part of the control process. The temperature is measured at fixed time intervals and the value is stored in an array, PTemp. The array contains 100 elements, representing 100 temperature values. The first element is PTemp[1].
The program will check whether the temperature is outside the acceptable range more than 20 times. This task is performed by a function, IsTempOK().
The algorithm for the function IsTempOK() is expressed in structured English as follows:
1 Examine each array element and count the number of times that a temperature is less than MinTemp or more than MaxTemp. 2 If the count in step 1 exceeds 20, return FALSE, otherwise return TRUE.
Draw a program flowchart, on the next page, to represent the algorithm for the function IsTempOK().
Assume:
- the array contains 100 valid temperature values
- PTemp, MinTemp and MaxTemp are global variables.
Note that variable declarations are not required in program flowcharts.
Question 9
Question 10
Why this question appears here
82% assigned-topic match · Hardware › Logic gates and logic circuits
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_23.pdf
