A program will store attendance data about each employee of a company. The data will be held in a record structure of type Employee. The fields that will be needed are as shown: | Field | Typical value | Comment | |---|---|---| | EmployeeNumber | 123 | A numeric value starting from 1 | | Name | "Smith, Eric" | Format: <last name>','<first name> | | Department | "1B" | May contain letters and numbers | | Born | 13/02/2006 | Must not be before 04/02/1957 | | Attendance | 97.40 | Represents a percentage |
- (a)(i)Write pseudocode to declare the record structure for type Employee.[4]
- (a)(ii)A 1D array Staff containing 500 elements will be used to store the employee records. Write pseudocode to declare the Staff array.[2]
- (b)(i)There may be more records in the array than there are employees in the company. In this case, some records of the array will be unused. State why it is good practice to have a standard way to indicate unused array elements.[1]
- (b)(ii)Give one way of indicating an unused record in the Staff array.[1]
- (c)A procedure Absentees() will output the EmployeeNumber and the Name of all employees who have an Attendance value of 90.00 or less. Write pseudocode for the procedure Absentees(). Assume that the Staff array is global.[4]
Mark scheme
Marking points from the official mark scheme (May/June 2022). The mark or mark type is shown in brackets.
- [4] (a)(i) TYPE Employee and ENDTYPE
- [4] (a)(i) Fields: EmployeeNumber and Name and Department
- [4] (a)(i) Field: Born
- [4] (a)(i) Field: Attendance
- [2] (a)(ii) DECLARE Staff : ARRAY [1:500] OF Employee
- [2] (a)(ii) One mark per underlined phrase
- [1] (b)(i) So that unused elements may be recognised when processing / searching
- [1] (b)(i) Otherwise the element may contain old / unexpected data
- [1] (b)(ii) An EmployeeNumber field. e.g. < 1
- [1] (b)(ii) An empty string / impossible string e.g. "EMPTY" for name or department
- [1] (b)(ii) DOB a long time ago...
- [1] (b)(ii) Zero / Negative value for attendance
- [4] (c) Marks as follows to Max 4: 1 Procedure heading and ending and declaration of loop counter
- [4] (c) 2 loop through 500 elements
- [4] (c) 3 attempt to skip unused element
- [4] (c) 4 test Staff [Index].Attendance <= 90 in a loop
- [4] (c) 5 if so, output EmployeeNumber and Name fields in a loop
Write your answer and get it marked
On Oracle Prep you can write or photograph your own answer and have it marked by AI against this mark scheme, with feedback on what you missed.
Sign up free →