Question 3(e)(ii) 2023 · May-June · Paper 42 · 1 mark
Reveal official mark-scheme answer
Official answer for Question 3
Part (e)
(ii)
Question 1
mark for screenshot e.g.
Question 1
Show text version of question
Question 3
Part (e)
(ii)
Question 3
A company needs a computer program to store data about its employees.
Part of the program is being written using object‑oriented programming.
The class Employee stores data about the employees. Each employee has an employee number, a job title and hourly pay rate. The class will also store the amount they are paid each week over a 52‑week year in a 1D array.
Employee HourlyPay : REAL stores the amount each employee gets paid each hour
EmployeeNumber : STRING stores the employee’s unique number
JobTitle : STRING stores the employee’s job title
PayYear2022 : ARRAY[0:51] OF REAL stores the amount the employee has been paid each week Constructor() initialises HourlyPay, EmployeeNumber and JobTitle from the values passed as parameters initialises all 52 elements in PayYear2022 to 0.0
GetEmployeeNumber() returns the employee number
SetPay() takes the week number and number of hours worked that week as parameters calculates and stores the pay for that week in PayYear2022
GetTotalPay() returns the total of all the values in PayYear2022
(ii)
Test your program.
Take a screenshot of the output.
Save your program.
Copy and paste the screenshot into part 3(e)(ii) in the evidence document.
Permission to reproduce items where third‑party owned material protected by copyright is included has been sought and cleared where possible. Every reasonable effort has been made by the publisher (UCLES) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the publisher will be pleased to make amends at the earliest possible opportunity.
To avoid the issue of disclosure of answer‑related information to candidates, all copyright acknowledgements are reproduced online in the Cambridge Assessment International Education Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download at www.cambridgeinternational.org after the live examination series.
Cambridge Assessment International Education is part of Cambridge Assessment. Cambridge Assessment is the brand name of the University of Cambridge Local Examinations Syndicate (UCLES), which is a department of the University of Cambridge.
Why this question appears here
71% assigned-topic match · Programming › Constructs
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 9618_s23_qp_42.pdf
