Question 5
Edexcel Computer Science June 2018 Paper 2GCSE8 marks
On the specification
- (a)
- 6.6 Subprograms
- (b)
- 6.6 Subprograms
- (c)
- 6.6 Subprograms
- (d)
- 6.6 Subprograms1.1 Decomposition and abstraction
Question text
5 P-Cubed uses automatic sorting machines. 3 The sorting machines can only handle items up to 1000 cubic centimetres (cm ) in volume. The volume of an item is calculated by this expression: volume = width x height x length Here is the partially completed pseudo-code for an algorithm that calculates the volume of an item. (a) The function ‘calcVolume’ represents a generalisation that calculates the volume for any item. Complete the pseudo-code by filling in the boxes. (4) (b) State the reason why ‘calcVolume’ is a function not a procedure. (1) (c) State the name of a local variable in the pseudo-code. (1) (d) State two benefits to the programmer of using libraries in a program. (2) 1 2 (Total for Question 5 = 8 marks)