Question 4(c)(i) 2019 · October-November · Paper 22 · 2 marks
Reveal official mark-scheme answer
Official answer for Question 4
Part (c)
(i)
Question 2
Show text version of question
Question 4
Part (c)
(i)
Question 4
A program is being written to control the operation of a portable music player. One part of the
program controls the output volume.
The player has two buttons, one to increase the volume and one to decrease it. Whenever a button is pressed, a procedure Button() is called with a parameter value representing the button as follows:
Button Parameter value
Volume increase 10
Volume decrease 20
For example, pressing the volume increase button three times followed by pressing the volume decrease button once would result in the calls:
CALL Button(10) // VolLevel increased by 1 CALL Button(10) // VolLevel increased by 1 CALL Button(10) // VolLevel increased by 1 CALL Button(20) // VolLevel decreased by 1
The program makes use of two global variables of type INTEGER as follows:
Variable Description VolLevel The current volume setting. This must be in the range 0 to 49.
in order to protect the user’s hearing. MaxVol
The procedure Button() will modify the value of VolLevel depending on which button has been pressed and whether a maximum value has been set.
Question 9
The testing stage is part of the program development cycle.
(i)
The program for the music player has been completed. The program does not contain
any syntax errors, but testing could reveal further errors.
Identify and describe one different type of error that testing could reveal.
Type ..................................................................................................................................
Description ........................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
Why this question appears here
71% 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_w19_qp_22.pdf
