Quelpr

CAPE Computer Science Unit 1 · 2009 · Paper 2 · Question 6(c)

Employee records for Smith (ID 1000), Jones (ID 1001), and Singh (ID 1002) are maintained using struct payRec, tracking totalPay and numDays (initially 0).

Complete the main C program using the provided declarations to repeatedly read input data (id, hrs, rate) until sentinel ID 999 is entered, calculating daily salary and updating totalPay and numDays for each corresponding employee, then printing each employee's ID, total pay, and days worked as illustrated in the sample screen.

This question uses a figure or table from the paper — you'll see it when you practise.

The mark scheme is shown once you've answered.

Practise this question

Other parts of this question

  1. 6(a)(i)Briefly describe the declarative classification of programming languages.[2 marks]
  2. 6(a)(ii)Briefly describe the imperative (procedural) classification of programming languages.[2 marks]
  3. 6(a)(iii)Briefly describe the scripting classification of programming languages.[2 marks]
  4. 6(b)Distinguish between 'syntax' and 'semantics' in computer programming.[3 marks]

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