Question 8
Edexcel Computer Science June 2020 Paper 2GCSE12 marks
On the specification
- (a)
- 6.3 Data types and structures
- (b)
- 6.6 Subprograms
- (c)
- 6.6 Subprograms
- (d)
- 6.6 Subprograms
Question text
8 The airport has two runways. Each runway has a queue of planes waiting to take off. Only five planes can be queued for each runway. Other planes remain at the gate until a place is free. When a plane leaves the gate, its details are added to a runway queue. This process is controlled by a computer program. Here is an algorithm for the process of adding planes to the runway queues. (a) Give a line number of an instruction in the algorithm that assigns a value to an element of an array. (1) (b) The algorithm is incomplete. Line 9 should hold the pseudocode for the function header. Line 35 should hold a call to the function. Construct the code for line 9 and line 35. (6) Line 9 Line 35 (c) A subprogram can be either a function or a procedure. State why planeQueue is a function. (1) (d) The scope of a variable can be either global or local. Compare the scope and memory use of the variable ‘status’ referred to on line 6 of the algorithm, with the variable ‘status’ referred to on line 12. (4) (Total for Question 8 = 12 marks)