Computer Science For First Examination In 2021 9618 · 10

Data types and structures

7 questions. Open a question to solve it and check the official answer.

Reset
2025 May-June · Paper 43 · Q3(b)(iii)

Data types and records · 3 marks · official answer ready

(iii) The method Traverse() concatenates the integer data from the nodes in the linked list, starting with the node stored in HeadNode. The method returns the final string with ea…

2023 May-June · Paper 42 · Q3(a)(i)

Data types and records · 5 marks · official answer ready

(i) Write program code to declare the class Employee. You only need to declare the class and its constructor. Do not declare any other methods. Use your programming language appro…

2023 May-June · Paper 42 · Q3(a)(iii)

Data types and records · 3 marks · official answer ready

(iii) The method SetPay(): • takes a week number and the number of hours worked that week as parameters • calculates the pay for that week by multiplying the hourly pay by the num…

2023 May-June · Paper 42 · Q3(a)(iv)

Data types and records · 2 marks · official answer ready

(iv) The method GetTotalPay() returns the total of all the values in PayYear2022. Write program code for the method GetTotalPay(). Save your program. Copy and paste the program co…

2023 May-June · Paper 42 · Q3(b)(ii)

Data types and records · 3 marks · official answer ready

(ii) The Manager method SetPay() overrides the method from the parent class and: • takes the week number and number of hours worked as parameters • increases the number of hours w…

2023 May-June · Paper 42 · Q3(d)

Data types and records · 4 marks · official answer ready

(d) The file HoursWeek1.txt stores the number of hours each employee has worked in week 1, in the order: • employee number • number of hours worked. For example, the first set of …

2023 May-June · Paper 42 · Q3(e)(i)

Data types and records · 2 marks · official answer ready

(i) The main program needs to call EnterHours() and use the method GetTotalPay() to output the employee number and total pay for each of the eight employees. Amend the main progra…