Question 1

AQA Computer Science June 2020 Paper 1GCSE10 marks

On the specification

1.1
3.3 Fundamentals of data representation
1.2
3.3 Fundamentals of data representation
1.3
3.3 Fundamentals of data representation
1.4
3.2 Programming3.3 Fundamentals of data representation
Question text

1.1 A bitmap image is represented as a grid of pixels. State what is meant by the term pixel. [1 mark] 1.2 State the maximum number of different colours that can be used if a bitmap image has a colour depth of six bits. [1 mark] 1.3 What is the minimum file size for an 800 pixel by 1000 pixel bitmap image that uses 20 different colours? You should give your answer in kilobytes. You should show your working. [3 marks] Answer kB 1.4 The algorithm shown in Figure 1 converts binary data entered as a string by the user into a representation of a black and white image. The algorithm uses the + operator to concatenate two strings. Characters in the string are indexed starting at zero. For example bdata[2] would access the third character of the string stored in the variable bdata The MOD operator calculates the remainder after integer division, for example 17 MOD 5 = 2 Figure 1 bdata ← USERINPUT image ← '' FOR i ← 0 TO LEN(bdata) - 1 IF bdata[i] = '0' THEN image ← image + '*' ELSE image ← image + '/' ENDIF IF i MOD 3 = 2 THEN OUTPUT image image ← '' ENDIF ENDFOR Complete the trace table for the algorithm shown in Figure 1 when the variable bdata is given the following value from the user: 110101 You may not need to use every row in the table. The algorithm output is not required. [3 marks] i image