Question 1

Edexcel Computer Science June 2024 Paper 1GCSE16 marks

On the specification

(a)
1.1 Decomposition and abstraction
(b)
1.1 Decomposition and abstraction
(c)(i)
6.2 Program constructs
(c)(ii)
6.2 Program constructs
(c)(iii)
6.2 Program constructs
(d)(i)
6.1 Develop code
(d)(ii)
6.1 Develop code
(e)(i)
6.5 Operators
(e)(ii)
6.5 Operators
(f)(i)
1.2 Algorithms
(f)(ii)
1.2 Algorithms
Question text

1 Computational thinking (a) Identify the term that means breaking a problem or solution down into smaller parts. (1) A Abstraction B Computation C Decomposition D Evaluation (b) State two benefits of subprograms. (2) 1 2 (c) Here is an algorithm that uses colours. 1 # ------------------------------------------------------- 2 # Global variables 3 # ------------------------------------------------------- 4 theColours = ["Green", "Blue", "Yellow", "Red", "Purple"] 5 colour = "" 6 7 # ------------------------------------------------------- 8 # Main program 9 # ------------------------------------------------------- 10 11 for item in theColours: 12 print (item) 13 14 colour = input ("Enter a colour: ") 15 while (colour != ""): 16 if (colour == "Green"): 17 print ("Green is my favourite colour") 18 else: 19 print (colour + " is a good colour") 20 21 colour = input ("Enter a colour: ") (i) Give the first line number of a condition-controlled loop. (1) (ii) Give the first line number of iteration over every item in a data structure. (1) (iii) Give the line numbers of a selection. (1) (d) Programs can have syntax errors and runtime errors. (i) Define the term ‘syntax error’. (1) (ii) Runtime errors happen when a program is executing. Explain a runtime error. (2) (e) Algorithms use relational and arithmetic operators. (i) Here is a relational operator used in a conditional test. count > index State the two different results of evaluating a conditional test. (2) 1 2 (ii) Identify the result of 5 // 2 (1) A 0.5 B 1 C 2 D 2.5 (f ) Programmers consider algorithm efficiency when they write code. (i) Sorting and searching use algorithms. Complete the table with the name of a search algorithm and a sort algorithm. (2) Algorithm type Characteristic Algorithm name Is a divide and Search conquer algorithm Is not a divide and Sort conquer algorithm (ii) Explain one effect the number of comparisons has on the execution time of a sorting algorithm. (2) (Total for Question 1 = 16 marks)