Question 3

OCR Computer Science Specimen Paper 2AS9 marks

On the specification

(a)
2.2 Problem solving and programming
(b)
2.2 Problem solving and programming
(c)
2.2 Problem solving and programming
(d)
2.2 Problem solving and programming
Question text

3 (a) Describe one difference between a global and a local variable. [2] (b) Explain, using one example, why global variables are sometimes used in a program. [3] (c) Explain why good programming practice generally avoids the use of global variables. [2] (d) Explain why parameter passing to a function can be a better alternative to using global variables. [2]