Question 4

Edexcel Computer Science June 2023 Paper 1GCSE20 marks

On the specification

(a)
1.2 Algorithms
(b)
6.3 Data types and structures
(c)
1.2 Algorithms6.5 Operators
(d)
1.2 Algorithms
(e)
1.3 Truth tables
(f)
1.1 Decomposition and abstraction6.1 Develop code
Question text

4 Computational thinking (a) Programmers use trace tables with algorithms. Explain the purpose of a trace table. (2) (b) Algorithms use arrays and records to hold data. Describe a record. (2) (c) An algorithm allows users to enter a whole number. The number can be positive or negative. The purpose of the algorithm is to report whether the number is even or odd. The modulus function returns the remainder after division. The algorithm can be expressed as a flowchart. Here are some flowchart symbols: Terminator Process Decision Input/Output Complete the flowchart to show the algorithm. You may not need to use all the flowchart symbols. (4) Start Stop (d) A linear search algorithm can be used on both a sorted and an unsorted array. Describe how a linear search algorithm operates on an unsorted array. (4) (e) Algorithms control physical devices using logical operators. A security system turns on a floodlight when the sunlight falls below a certain level (S) and a movement sensor is activated (M). Complete the truth table. (2) S M S AND M (f ) A group of students are working together on a single maze game. The arrow keys control the character. When the character reaches the end of the maze without touching a wall, a happy sound is played. The game also displays a score. Discuss the use of decomposition and abstraction in developing this game. Your answer should include: • a definition of each term • the benefits each brings to the group of students • an example of where each could appear in the program code. (6)