Past-paper question · 2022 May-June · Paper 12 · Q9(a)

Question 9(a) 2022 · May-June · Paper 12 · 6 marks

Original past-paper question for 9(A)
Original past-paper question for 9(A)
Reveal official mark-scheme answer Official mark-scheme answer for 9(A)

Official answer for Question 9

Part (a)

✓
READ first record in transaction file

Question 6

✓
READ first record in old master file
✓
WHILE not end of transaction file
✓
IF transaction file WorkerID = master file WorkerID
✓
THEN
✓
WagesSoFar ← WagesSoFar + (RateOfPay*HoursWorked)
✓
WRITE updated master file record to new master file
✓
READ next record in transaction file
✓
ENDIF
✓
READ next record in master file
✓
ENDWHILE
✓
Six from:
✓
Correct calculation – RateOfPay*HoursWorked - 1 mark
✓
Correct calculation - WagesSoFar ← WagesSoFar +
✓
(RateOfPay*HoursWorked) – 1 mark
✓
Correct update – 1 mark
✓
Read next transaction file record… – 1 mark
✓
…immediately before ENDIF – 1 mark
✓
ENDIF– 1 mark
✓
Read next master file record… – 1 mark
✓
… immediately after ENDIF – 1 mark
✓
ENDWHILE at end of algorithm – 1 mark
✓
9626/12
✓
Cambridge International AS & A Level – Mark Scheme
✓
May/June 2022
✓
PUBLISHED
✓
Question
✓
Answer
✓
Marks

Mark scheme 9626_s22_ms_12.pdf →

Show text version of question

Question 9

Part (a)

Question 9

Many companies use computers to process their payroll.

A
transaction file is produced once a week. It consists of the WorkerID and HoursWorked fields.

The master file contains the WorkerID, RateOfPay and WagesSoFar fields as well as other details. The WagesSoFar field represents how much each worker has earned so far this year.

Each worker’s wage is calculated by multiplying the HoursWorked by the RateOfPay. When the wage for that week is calculated, it is added on to the WagesSoFar field.

Every week the master file has to be updated to include the new wage earned so far this year.

Part (a)

Complete the following pseudocode algorithm which shows the process of updating the

master file. You can assume no other transactions are being carried out.

READ first record in transaction file READ first record in old master file WHILE not end of transaction file IF transaction file WorkerID = master file WorkerID THEN

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

.............................................................................................................................................

[6]

Question 11

Topic relevance

Why this question appears here

80% assigned-topic match · Algorithms and flowcharts › Algorithms and flowcharts

Topic-match percentages estimate how closely each question fits the selected syllabus topic. They are a guide for choosing stricter or broader practice.

Permanent source page: Educate A Change · From 9626_s22_qp_12.pdf

Keep practising this topic