Question 4

OCR Computer Science June 2019 Paper 2GCSE10 marks

On the specification

(a)(i)
2.1 Algorithms
(a)(ii)
2.1 Algorithms
(b)
2.3 Producing robust programs
(c)
2.1 Algorithms2.2 Programming techniques
Question text

4 Elliott plays football for OCR FC. He wants to create a program to store the results of each football match they play and the names of the goal scorers. Elliott wants individual players from the team to be able to submit this information. (a) (i) Define what is meant by abstraction. [2] (ii) Give one example of how abstraction could be used when developing this program. [1] (b) Describe two examples of defensive design that should be considered when developing this program. 1 2 [4] The number of goals scored in each football match is held in an array called goals. An example of this array is shown. goals = [0, 1, 3, 0, 4, 5, 2, 0, 2, 1] Elliott wants to count how many matches end with 0 goals. (c) Complete the following pseudocode for an algorithm to count up how many matches with 0 goals are stored in the array and then print out this value. 1 nogoalscount = 0 2 for count = 0 to (goals.length-1) 3 if goals[ ] == 0 then 4 nogoalscount 5 endif 6 next count 7 print( ) [3]