Question 5
Edexcel Computer Science June 2022 Paper 1GCSE18 marks
On the specification
- (a)(i)
- 6.3 Data types and structures
- (a)(ii)
- 6.3 Data types and structures
- (a)(iii)
- 1.1 Decomposition and abstraction
- (a)(iv)
- 1.1 Decomposition and abstraction
- (b)
- 1.2 Algorithms
- (c)
- 1.2 Algorithms
- (d)
- 1.2 Algorithms
Question text
5 Computational thinking (a) Here is an algorithm that prints colours. (i) State the type of data structure used to hold the ink colours. (1) (ii) Give the contents of inkColours[2] (1) (iii) State the name of the computational thinking technique used by the subprogram displayAll() to hide the logic of printing. (1) (iv) State the name of the computational thinking technique used when separating logic into different blocks, such as the subprogram and the main program. (1) (b) This algorithm searches a sorted array of numbers for a target value. The target value may or may not be in the array. The use of the found variable helps to make the algorithm efficient. Describe how the use of the passed variable also helps to make the algorithm efficient. (2) (c) Laura owns a fruit shop. This program checks the weight of boxes of strawberries from Laura’s shop. The inputs are 404, 393, 395, 405. Complete the trace table showing the execution of the program with these inputs. You may not need to fill in all the rows in the table. (6) count accept reject weight Display (d) An algorithm is required that allows a user to enter two numbers. The algorithm then informs the user which number is greater, or whether the two numbers are equal. The algorithm is expressed in a flowchart. Here are some flowchart symbols: Terminator Process Decision Input/Output Draw a flowchart to show this algorithm. (6) (Total for Question 5 = 18 marks)