Question bank › GCSE Computer Science › Programming

Structured programming & subroutines

Answer on paper first, then reveal the mark scheme one mark at a time.

1Grade 6–76 marks

Look at this subroutine.

SUBROUTINE calcPrice(price, member)
   IF member = True THEN
      RETURN price * 0.9
   ELSE
      RETURN price
   ENDIF
ENDSUBROUTINE

(a) State one parameter used in the subroutine. [1]

(b) State the value returned by calcPrice(40, True). [1]

(c) Explain the difference between a local variable and a global variable. [2]

(d) Give two advantages of using subroutines in a program. [2]

Still losing marks on this topic?

Book a free introductory session and we'll find exactly which step is costing you.

Book a free intro