Quelpr

CAPE Computer Science Unit 1 · 2010 · Paper 2 · Question 6(a)

Questions on programming style, data structures, and C functions.

Describe THREE different ways in which the programming style of the given code snippet can be improved, using line numbers in your response.

The mark scheme is shown once you've answered.

Practise this question

Other parts of this question

  1. 6(b)What is the purpose of a 'struct' in C?[2 marks]
  2. 6(c)(i)Write a function which accepts two unique integers, x and y, and returns the larger of the two. Show how your function would be called.[6 marks]
  3. 6(c)(ii)Write a function which accepts a character, ch, and returns 1 if the character is a letter of the alphabet or 0 otherwise. Show how your function would be…[6 marks]
  4. 6(c)(iii)Write a function which accepts a character, ch, and returns 1 if the character is present in the string 'CAPECOMPUTERSCIENCE', or 0 if ch is not present.[5 marks]

More practice: the rest of this paper · more Modular Programming and Data Structures questions · all CAPE Computer Science Unit 1 past papers