Question 6(b) 2018 · May-June · Paper 21 · 8 marks
Reveal official mark-scheme answer
Official answer for Question 6
Part (b)
Question 1
Question 2
Show text version of question
Question 6
Part (b)
Part (b)
A 2D array, Picture, contains data representing a bitmap image. Each element of the array
represents one pixel of the image. The image is grey-scale encoded where the value of each pixel ranges from 0 (representing black) to 255 (representing white) with intermediate values representing different levels of grey.
The following is an example of an image and the corresponding data values for the Picture array.
Bitmap image Values
In pseudocode, the array is declared as follows:
DECLARE Picture : ARRAY[1:8, 1:8] OF INTEGER
Question 13
‘burn out’. An image is said to be ‘burnt out’ if any pixel is set to the maximum value of 255.
The function Lighten() will:
1. increase the value of each pixel by 10% 2. return TRUE if the resultant image is ‘burnt out’.
Write pseudocode to implement the Lighten() function.
Assume that the array Picture is a global variable.
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
......................................................................................................................................................[8]
Question 14
Why this question appears here
91% assigned-topic match · Data types and structures › Data types and records
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
