Data types and structures
7 questions. Open a question to solve it and check the official answer.
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…
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…
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…
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…
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…
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 …
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…
