Cambridge A Level Computer Science 9608 — 2019 Oct/Nov Paper 4 · Variant 2

9608/42/O/N/19 · 75 marks · ≈84 min

The question paper and its mark scheme, free to read here and free to download. This is Cambridge’s own paper, exactly as it was sat.

← All Computer Science papersWhat was in this paper?

Question paper20 pages

Cambridge A Level Computer Science 9608 2019 Oct/Nov Paper 4 · Variant 2 question paper, page 1 of 20
Page 1 of 20
Cambridge A Level Computer Science 9608 2019 Oct/Nov Paper 4 · Variant 2 question paper, page 2 of 20
Page 2 of 20
Cambridge A Level Computer Science 9608 2019 Oct/Nov Paper 4 · Variant 2 question paper, page 3 of 20
Page 3 of 20
Cambridge A Level Computer Science 9608 2019 Oct/Nov Paper 4 · Variant 2 question paper, page 4 of 20
Page 4 of 20
Cambridge A Level Computer Science 9608 2019 Oct/Nov Paper 4 · Variant 2 question paper, page 5 of 20
Page 5 of 20
Cambridge A Level Computer Science 9608 2019 Oct/Nov Paper 4 · Variant 2 question paper, page 6 of 20
Page 6 of 20
Cambridge A Level Computer Science 9608 2019 Oct/Nov Paper 4 · Variant 2 question paper, page 7 of 20
Page 7 of 20
Cambridge A Level Computer Science 9608 2019 Oct/Nov Paper 4 · Variant 2 question paper, page 8 of 20
Page 8 of 20
Cambridge A Level Computer Science 9608 2019 Oct/Nov Paper 4 · Variant 2 question paper, page 9 of 20
Page 9 of 20
Cambridge A Level Computer Science 9608 2019 Oct/Nov Paper 4 · Variant 2 question paper, page 10 of 20
Page 10 of 20
Cambridge A Level Computer Science 9608 2019 Oct/Nov Paper 4 · Variant 2 question paper, page 11 of 20
Page 11 of 20
Cambridge A Level Computer Science 9608 2019 Oct/Nov Paper 4 · Variant 2 question paper, page 12 of 20
Page 12 of 20
Cambridge A Level Computer Science 9608 2019 Oct/Nov Paper 4 · Variant 2 question paper, page 13 of 20
Page 13 of 20
Cambridge A Level Computer Science 9608 2019 Oct/Nov Paper 4 · Variant 2 question paper, page 14 of 20
Page 14 of 20
Cambridge A Level Computer Science 9608 2019 Oct/Nov Paper 4 · Variant 2 question paper, page 15 of 20
Page 15 of 20
Cambridge A Level Computer Science 9608 2019 Oct/Nov Paper 4 · Variant 2 question paper, page 16 of 20
Page 16 of 20
Cambridge A Level Computer Science 9608 2019 Oct/Nov Paper 4 · Variant 2 question paper, page 17 of 20
Page 17 of 20
Cambridge A Level Computer Science 9608 2019 Oct/Nov Paper 4 · Variant 2 question paper, page 18 of 20
Page 18 of 20
Cambridge A Level Computer Science 9608 2019 Oct/Nov Paper 4 · Variant 2 question paper, page 19 of 20
Page 19 of 20
Cambridge A Level Computer Science 9608 2019 Oct/Nov Paper 4 · Variant 2 question paper, page 20 of 20
Page 20 of 20

Mark scheme20 pages

Answers below. Sit the paper first if you are practising.

Mark scheme, page 1 of 20
Page 1 of 20
Mark scheme, page 2 of 20
Page 2 of 20
Mark scheme, page 3 of 20
Page 3 of 20
Mark scheme, page 4 of 20
Page 4 of 20
Mark scheme, page 5 of 20
Page 5 of 20
Mark scheme, page 6 of 20
Page 6 of 20
Mark scheme, page 7 of 20
Page 7 of 20
Mark scheme, page 8 of 20
Page 8 of 20
Mark scheme, page 9 of 20
Page 9 of 20
Mark scheme, page 10 of 20
Page 10 of 20
Mark scheme, page 11 of 20
Page 11 of 20
Mark scheme, page 12 of 20
Page 12 of 20
Mark scheme, page 13 of 20
Page 13 of 20
Mark scheme, page 14 of 20
Page 14 of 20
Mark scheme, page 15 of 20
Page 15 of 20
Mark scheme, page 16 of 20
Page 16 of 20
Mark scheme, page 17 of 20
Page 17 of 20
Mark scheme, page 18 of 20
Page 18 of 20
Mark scheme, page 19 of 20
Page 19 of 20
Mark scheme, page 20 of 20
Page 20 of 20

Paper as text

Question paper, page 1

This document consists of 17 printed pages and 3 blank pages. DC (LEG/FC) 168337/3 © UCLES 2019 [Turn over * 4 4 6 1 3 8 8 7 1 2 * COMPUTER SCIENCE 9608/42 Paper 4 Further Problem-solving and Programming Skills October/November 2019 2 hours Candidates answer on the Question Paper. No Additional Materials are required. No calculators allowed. READ THESE INSTRUCTIONS FIRST Write your centre number, candidate number and name in the spaces at the top of this page. Write in dark blue or black pen. You may use an HB pencil for any diagrams, graphs or rough working. Do not use staples, paper clips, glue or correction fluid. DO NOT WRITE IN ANY BARCODES. Answer all questions. No marks will be awarded for using brand names of software packages or hardware. At the end of the examination, fasten all your work securely together. The number of marks is given in brackets [ ] at the end of each question or part question. The maximum number of marks is 75. Cambridge Assessment International Education Cambridge International Advanced Subsidiary and Advanced Level

Question paper, page 2

2 9608/42/O/N/19 © UCLES 2019 1 A technology company needs software to calculate how much each employee should be paid. (a) Developing the software will involve the following activities: Activity Description Time to complete (weeks) Predecessor A Identify requirements 1 – B Observe current system 1 A C Create algorithm design 3 B D Write code 10 C E Test modules 7 C F White box testing 2 D G Black box testing 3 D H Install software 1 E, F, G I Acceptance testing 2 H J Create user documentation 2 H (i) Add the correct activities and times to the following Program Evaluation Review Technique (PERT) chart for the software development. Three of the activities and times have been done for you. 1 2 F 2 2 A I 1 6 11 9 7 5 8 3 10 4 [7]

Question paper, page 3

3 9608/42/O/N/19 © UCLES 2019 [Turn over (ii) The dashed line connecting nodes 10 and 11 indicates a dummy activity. State the purpose of a dummy activity. … … [1] (b) A bonus payment may be added to an employee’s salary. A pension payment may also be subtracted from an employee’s salary. The company needs to assess what additions and subtractions should be made to the salary of each employee. There are three conditions to check: • If the employee has worked a public holiday, they receive a 3% bonus payment. • If the employee has worked 160 or more hours in a month, they receive an additional 5% bonus payment. • If the employee pays into a pension, the company subtracts 4% for the pension payment. Complete the decision table to show the additions and subtractions. Rules Conditions Public holiday Y Y Y Y N N N N Hours >= 160 Y Y N N Y Y N N Pension Y N Y N Y N Y N Actions 3% bonus payment 5% bonus payment 4% pension payment [3]

Question paper, page 4

4 9608/42/O/N/19 © UCLES 2019 (c) The company decides to implement a program for the software using object-oriented programming (OOP). Each employee has a unique employee ID, name, address and date of birth. There are two types of employee: salary and apprenticeship. Salaried employees are paid a fixed monthly payment. The hours a salary employee works in a month are recorded to calculate bonus payments. They may receive bonus payments and make pension payments (given in part(b)). Apprenticeship employees are paid weekly. They receive an hourly rate of pay. Apprenticeship employees do not receive bonus payments or make pension payments. (i) Complete the following class diagram for the program. Employee EmployeeID : STRING Name : STRING Address : STRING DateOfBirth : Date Constructor() GetEmployeeID() GetName() GetAddress() GetDateOfBirth() SetEmployeeID() SetName() SetAddress() SetDateOfBirth() SalaryEmployee ApprenticeshipEmployee MonthlyPayment : CURRENCY HoursThisMonth: REAL PublicHoliday : BOOLEAN Pension : BOOLEAN … … Constructor() GetMonthlyPayment() GetHoursThisMonth() GetPublicHoliday() GetPension() SetMonthlyPayment() SetHoursThisMonth() SetPublicHoliday() SetPension() … … GetHourlyRate() GetHoursThisWeek() SetHourlyRate() [3]

Question paper, page 5

5 9608/42/O/N/19 © UCLES 2019 [Turn over (ii) Write program code for the Constructor() in the Employee class. All properties are sent as parameters. Programming language … Program code … … … … … … … … … … [4] (iii) Write program code for the GetEmployeeID()method in the Employee class. The get method returns the value of the EmployeeID property. Programming language … Program code … … … … … … [2]

Question paper, page 6

6 9608/42/O/N/19 © UCLES 2019 (iv) Write program code for the SetEmployeeID()method in the Employee class. The set method takes the new value as its parameter. Programming language … Program code … … … … … … [2] (v) Write program code for the SetPension()method in the SalaryEmployee()class. • The method takes a new value for Pension as a parameter. • If the parameter’s value is valid (it is TRUE or FALSE), the method returns TRUE and sets the parameter’s value. • Otherwise the method returns FALSE and does not set Pension. Programming language … Program code … … … … … … … … … … [4]

Question paper, page 7

7 9608/42/O/N/19 © UCLES 2019 [Turn over Question 1 continues on the next page.

Question paper, page 8

8 9608/42/O/N/19 © UCLES 2019 (vi) A SalaryEmployee is paid a fixed monthly payment. • If the employee has worked a public holiday, they receive a 3% bonus payment. This is calculated from their MonthlyPayment. • If the employee has worked 160 or more hours in a month, they receive an additional 5% bonus payment, calculated from their MonthlyPayment. • If the employee pays into a pension, 4% will be subtracted from their MonthlyPayment. Monthly salary is the final payment the employee receives. For example, Chris is a SalaryEmployee. His fixed MonthlyPayment is $1000. He has worked a public holiday. He has worked 165 hours this month. He pays into a pension. • The public holiday bonus is $30 (3% of $1000) • The hours worked bonus payment is $50 (5% of $1000) • The pension payment is $40 (4% of $1000) Chris’s monthly salary is calculated as ($1000 + $30 + $50) − $40 = $1040 The function CalculateMonthlySalary()is used to calculate the monthly salary. It: • takes a SalaryEmployee as a parameter • calculates the bonus payments and pension payment • outputs the pension payment and total bonus payment • calculates and returns the monthly salary. Write program code for the function CalculateMonthlySalary(). Programming language … Program code … … … … … … … … … … …

Question paper, page 9

9 9608/42/O/N/19 © UCLES 2019 [Turn over … … … … … … … … … … … … … … … … … … … … … … … … … … … … [8]

Question paper, page 10

10 9608/42/O/N/19 © UCLES 2019 (d) Noona describes an example of a feature of object-oriented programming (OOP). She says: “One method exists in the parent class but is overwritten in the child class, to behave differently.” Identify the feature Noona has described. … [1] 2 The number of cars that cross a bridge is recorded each hour. This number is placed in a circular queue before being processed. (a) The queue is stored as an array, NumberQueue, with eight elements. The function AddToQueue adds a number to the queue. EndPointer and StartPointer are global variables. Complete the following pseudocode algorithm for the function AddToQueue. FUNCTION AddToQueue(Number : INTEGER) RETURNS BOOLEAN DECLARE TempPointer : INTEGER CONSTANT FirstIndex = 0 CONSTANT LastIndex = … TempPointer EndPointer + 1 IF … > LastIndex THEN TempPointer … ENDIF IF TempPointer = StartPointer THEN RETURN … ELSE EndPointer TempPointer NumberQueue[EndPointer] … RETURN TRUE ENDIF ENDFUNCTION [5]

Question paper, page 11

11 9608/42/O/N/19 © UCLES 2019 [Turn over (b) Describe how a number is removed from the circular queue to be processed. … … … … … … … … [4] (c) A queue is one example of an Abstract Data Type (ADT). Identify three other Abstract Data Types. 1 … 2 … 3 … [3]

Question paper, page 12

12 9608/42/O/N/19 © UCLES 2019 3 A company wants to test a program to check that it works. They can use different types of test data to do this. (a) Identify three different types of test data that the company can use. 1 … 2 … 3 … [3] (b) The programmer will make use of debugging features, when building and testing a program. (i) Two debugging features are described in the table. Write the correct name for each debugging feature. Description Name of debugging feature A point where the program can be halted to see if the program works to this point. … One statement is executed and then the program waits for input from the programmer to move on to the next statement. … [2] (ii) Identify and describe one other debugging feature. Debugging feature … Description … … [2]

Question paper, page 13

13 9608/42/O/N/19 © UCLES 2019 [Turn over 4 A bank wants to analyse how an automated teller machine (ATM) deals with transactions. The following state-transition table shows the transitions from one state to another for a transaction. Current state Event Next state ATM active Insert card Waiting for PIN Waiting for PIN Enter PIN Checking PIN Waiting for PIN Cancel selected Transaction cancelled Checking PIN PIN valid Account accessed Checking PIN PIN invalid Waiting for PIN Account accessed Cancel selected Transaction cancelled Account accessed Input amount to withdraw Checking account Checking account Funds available Transaction complete Transaction complete Return card and dispense cash ATM active Checking account Funds not available Account accessed Transaction cancelled Return card ATM active Complete the state-transition diagram to correspond with the table. Start ATM active Insert card Enter PIN Waiting for PIN Checking PIN Transaction cancelled Transaction complete Account accessed Input amount to withdraw Checking account [8]

Question paper, page 14

14 9608/42/O/N/19 © UCLES 2019 5 The following table shows part of the instruction set for a processor which has one general purpose register, the Accumulator (ACC) and an Index Register (IX). Instruction Explanation Op code Operand LDM #n Immediate addressing. Load the number n to ACC. LDD <address> Direct addressing. Load the contents of the location at the given address to ACC. LDI <address> Indirect addressing. The address to be used is at the given address. Load the contents of this second address to ACC. LDX <address> Indexed addressing. Form the address from <address> + the contents of the Index Register. Copy the contents of this calculated address to ACC. LDR #n Immediate addressing. Load the number n to IX. STO <address> Store the contents of ACC at the given address. STX <address> Indexed addressing. Form the address from <address> + the contents of the Index Register. Copy the contents from ACC to this calculated address. ADD <address> Add the contents of the given address to the ACC. INC <register> Add 1 to the contents of the register (ACC or IX). DEC <register> Subtract 1 from the contents of the register (ACC or IX). JMP <address> Jump to the given address. CMP <address> Compare the contents of ACC with the contents of <address>. CMP #n Compare the contents of ACC with number n. JPE <address> Following a compare instruction, jump to <address> if the compare was True. JPN <address> Following a compare instruction, jump to <address> if the compare was False. AND #n Bitwise AND operation of the contents of ACC with the operand. AND <address> Bitwise AND operation of the contents of ACC with the contents of <address>. XOR #n Bitwise XOR operation of the contents of ACC with the operand. XOR <address> Bitwise XOR operation of the contents of ACC with the contents of <address>. OR #n Bitwise OR operation of the contents of ACC with the operand. OR <address> Bitwise OR operation of the contents of ACC with the contents of <address>. <address> can be an absolute address or a symbolic address. LSL #n Bits in ACC are shifted n places to the left. Zeros are introduced on the right hand end. LSR #n Bits in ACC are shifted n places to the right. Zeros are introduced on the left hand end. IN Key in a character and store its ASCII value in ACC. OUT Output to the screen the character whose ASCII value is stored in ACC. END Return control to the operating system.

Question paper, page 15

15 9608/42/O/N/19 © UCLES 2019 [Turn over (a) A programmer needs a program that multiplies a binary number by 4. The programmer has started to write the program in the following table. The comment column contains explanations for the missing program instructions. Write the program using the given instruction set. Label Instruction Comment Op code Operand // load contents of NUMBER // perform shift to multiply by 4 // store contents of ACC in NUMBER // end program NUMBER: B00110110 [5] Note: # denotes immediate addressing B denotes a binary number, e.g. B01001010 & denotes a hexadecimal number, e.g. &4A

Question paper, page 16

16 9608/42/O/N/19 © UCLES 2019 (b) A programmer needs a program that counts the number of lower case letters in a string. The programmer has started to write the program in the following table. The comment column contains explanations for the missing program instructions. Complete the program using the given instruction set. A copy of the instruction set is provided on the opposite page. Label Instruction Comment Op code Operand LDR #0 // initialise Index Register to 0 START: // load the next value from the STRING // perform bitwise AND operation with MASK // check if result is equal to MASK // if FALSE, jump to UPPER // increment COUNT UPPER: INC IX // increment the Index Register // decrement LENGTH // is LENGTH = 0 ? // if FALSE, jump to START END // end program MASK: B00100000 // if bit 5 is 1, letter is lower case COUNT: 0 LENGTH: 5 STRING: B01001000 // ASCII code for 'H' B01100001 // ASCII code for 'a' B01110000 // ASCII code for 'p' B01110000 // ASCII code for 'p' B01011001 // ASCII code for 'Y' [8]

Question paper, page 17

17 9608/42/O/N/19 © UCLES 2019 Instruction Explanation Op code Operand LDM #n Immediate addressing. Load the number n to ACC. LDD <address> Direct addressing. Load the contents of the location at the given address to ACC. LDI <address> Indirect addressing. The address to be used is at the given address. Load the contents of this second address to ACC. LDX <address> Indexed addressing. Form the address from <address> + the contents of the Index Register. Copy the contents of this calculated address to ACC. LDR #n Immediate addressing. Load the number n to IX. STO <address> Store the contents of ACC at the given address. STX <address> Indexed addressing. Form the address from <address> + the contents of the Index Register. Copy the contents from ACC to this calculated address. ADD <address> Add the contents of the given address to the ACC. INC <register> Add 1 to the contents of the register (ACC or IX). DEC <register> Subtract 1 from the contents of the register (ACC or IX). JMP <address> Jump to the given address. CMP <address> Compare the contents of ACC with the contents of <address>. CMP #n Compare the contents of ACC with number n. JPE <address> Following a compare instruction, jump to <address> if the compare was True. JPN <address> Following a compare instruction, jump to <address> if the compare was False. AND #n Bitwise AND operation of the contents of ACC with the operand. AND <address> Bitwise AND operation of the contents of ACC with the contents of <address>. XOR #n Bitwise XOR operation of the contents of ACC with the operand. XOR <address> Bitwise XOR operation of the contents of ACC with the contents of <address>. OR #n Bitwise OR operation of the contents of ACC with the operand. OR <address> Bitwise OR operation of the contents of ACC with the contents of <address>. <address> can be an absolute address or a symbolic address. LSL #n Bits in ACC are shifted n places to the left. Zeros are introduced on the right hand end. LSR #n Bits in ACC are shifted n places to the right. Zeros are introduced on the left hand end. IN Key in a character and store its ASCII value in ACC. OUT Output to the screen the character whose ASCII value is stored in ACC. END Return control to the operating system.

Question paper, page 18

18 9608/42/O/N/19 © UCLES 2019 BLANK PAGE

Question paper, page 19

19 9608/42/O/N/19 © UCLES 2019 BLANK PAGE

Question paper, page 20

20 9608/42/O/N/19 © UCLES 2019 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 the Cambridge Assessment Group. Cambridge Assessment is the brand name of the University of Cambridge Local Examinations Syndicate (UCLES), which itself is a department of the University of Cambridge. BLANK PAGE

Mark scheme, page 1

This document consists of 20 printed pages. © UCLES 2019 [Turn over Cambridge Assessment International Education Cambridge International Advanced Subsidiary and Advanced Level COMPUTER SCIENCE 9608/42 Paper 4 Written Paper October/November 2019 MARK SCHEME Maximum Mark: 75 Published This mark scheme is published as an aid to teachers and candidates, to indicate the requirements of the examination. It shows the basis on which Examiners were instructed to award marks. It does not indicate the details of the discussions that took place at an Examiners’ meeting before marking began, which would have considered the acceptability of alternative answers. Mark schemes should be read in conjunction with the question paper and the Principal Examiner Report for Teachers. Cambridge International will not enter into discussions about these mark schemes. Cambridge International is publishing the mark schemes for the October/November 2019 series for most Cambridge IGCSE™, Cambridge International A and AS Level components and some Cambridge O Level components.

Mark scheme, page 2

9608/42 Cambridge International AS/A Level – Mark Scheme PUBLISHED October/November 2019 © UCLES 2019 Page 2 of 20 Generic Marking Principles These general marking principles must be applied by all examiners when marking candidate answers. They should be applied alongside the specific content of the mark scheme or generic level descriptors for a question. Each question paper and mark scheme will also comply with these marking principles. GENERIC MARKING PRINCIPLE 1: Marks must be awarded in line with: • the specific content of the mark scheme or the generic level descriptors for the question • the specific skills defined in the mark scheme or in the generic level descriptors for the question • the standard of response required by a candidate as exemplified by the standardisation scripts. GENERIC MARKING PRINCIPLE 2: Marks awarded are always whole marks (not half marks, or other fractions). GENERIC MARKING PRINCIPLE 3: Marks must be awarded positively: • marks are awarded for correct/valid answers, as defined in the mark scheme. However, credit is given for valid answers which go beyond the scope of the syllabus and mark scheme, referring to your Team Leader as appropriate • marks are awarded when candidates clearly demonstrate what they know and can do • marks are not deducted for errors • marks are not deducted for omissions • answers should only be judged on the quality of spelling, punctuation and grammar when these features are specifically assessed by the question as indicated by the mark scheme. The meaning, however, should be unambiguous. GENERIC MARKING PRINCIPLE 4: Rules must be applied consistently e.g. in situations where candidates have not followed instructions or in the application of generic level descriptors.

Mark scheme, page 3

9608/42 Cambridge International AS/A Level – Mark Scheme PUBLISHED October/November 2019 © UCLES 2019 Page 3 of 20 GENERIC MARKING PRINCIPLE 5: Marks should be awarded using the full range of marks defined in the mark scheme for the question (however; the use of the full mark range may be limited according to the quality of the candidate responses seen). GENERIC MARKING PRINCIPLE 6: Marks awarded are based solely on the requirements as defined in the mark scheme. Marks should not be awarded with grade thresholds or grade descriptors in mind.

Mark scheme, page 4

9608/42 Cambridge International AS/A Level – Mark Scheme PUBLISHED October/November 2019 © UCLES 2019 Page 4 of 20 Question Answer Marks 1(a)(i) 1 mark each bullet point: • B 1 • C 3 (following B) • D 10 (following C) • G 3 (following D) and nothing on dummy • E 7 (following C) and nothing on dummy • H1 in position • J 2 (following H) and nothing on dummy 7 1(a)(ii) 1 mark: • The next activity is dependent on the previous but there is no activity 1 1 2 A 1 3 4 5 8 7 6 9 11 10 F 2 2 B 1 C I 3 D 1 G 3 E I 7 H 1 J 2 I 6

Mark scheme, page 5

9608/42 Cambridge International AS/A Level – Mark Scheme PUBLISHED October/November 2019 © UCLES 2019 Page 5 of 20 Question Answer Marks 1(b) 1 mark per row Rules Conditions Public Holiday Y Y Y Y N N N N Hours >= 160 Y Y N N Y Y N N Pension Y N Y N Y N Y N Actions 3% bonus payment X X X X 5% bonus payment X X X X 4% Pension payment X X X X 3

Mark scheme, page 6

9608/42 Cambridge International AS/A Level – Mark Scheme PUBLISHED October/November 2019 © UCLES 2019 Page 6 of 20 Question Answer Marks 1(c)(i) Employee EmployeeID : STRING Name : STRING Address : STRING DateOfBirth : DATE Constructor () GetEmployeeID() GetName() GetAddress() GetDateOfBirth() SetEmployeeID() SetName() SetAddress() SetDateOfBirth() SalaryEmployee ApprenticeshipEmployee MonthlyPayment : CURRENCY HoursThisMonth : REAL PublicHoliday : BOOLEAN Pension : BOOLEAN HourlyRate : CURRENCY/REAL HoursThisWeek : REAL/INTEGER Constructor() GetMonthlyPayment() GetPension() GetPublicHoliday() GetHoursThisMonth() SetMonthlyPayment() SetPension() SetPublicHoliday() SetHoursThisMonth() Constructor() SetHoursThisWeek() GetHourlyRate() GetHoursThisWeek() SetHourlyRate() 3 1 mark per bullet point • inheritance (arrow filled or unfilled) • constructor and SetHoursThisWeek method for ApprenticeshipEmployee • HourlyRate and HoursThisWeek attributes for ApprenticeshipEmployee

Mark scheme, page 7

9608/42 Cambridge International AS/A Level – Mark Scheme PUBLISHED October/November 2019 © UCLES 2019 Page 7 of 20 Question Answer Marks 1(c)(ii) 1 mark per bullet point • Constructor header and close (where necessary) • All 4 values sent as parameters (ID, Name, Address, DateOfBirth) with any • Attributes/properties set to a value « • « that are the parameters Example code: Pascal Constructor Employee.init(ID, NewName, NewAddress, NewDateOfBirth : String); begin EmployeeID := ID; Name := NewName; Address := NewAddress; DateOfBirth := NewDateOfBirth; end; Python def __init__(self, ID, NewName, NewAddress, NewDateOfBirth): self.__EmployeeID = ID self.__Name = NewName self.__Address = NewAddress self.__DateOfBirth = NewDateOfBirth VB.NET Public Sub New(ID, NewName, NewAddress, NewDateOfBirth) EmployeeID = ID Name = NewName Address = NewAddress DateOfBirth = NewDateOfBirth End Sub 4

Mark scheme, page 8

9608/42 Cambridge International AS/A Level – Mark Scheme PUBLISHED October/November 2019 © UCLES 2019 Page 8 of 20 Question Answer Marks 1(c)(iii) 1 mark per bullet point • Get method header and close (where needed) with no parameters • Returns the attribute/property EmployeeID Example code: Pascal Function Employee.GetEmployeeID() : String; result := EmployeeID; end; Python def GetEmployeeID(self): return self.__EmployeeID VB.NET Public Function GetEmployeeID() As String Return EmployeeID End Function 2

Mark scheme, page 9

9608/42 Cambridge International AS/A Level – Mark Scheme PUBLISHED October/November 2019 © UCLES 2019 Page 9 of 20 Question Answer Marks 1(c)(iv) 1 mark per bullet point • Set method/procedure header and close (where needed) with parameter • Sets EmployeeID to value of parameter Example code: Pascal procedure Employee.SetEmployeeID(NewID: String); EmployeeID := NewID end; Python def SetEmployeeID(self, NewID): self.__EmployeeID = NewID VB.NET Public Sub SetEmployeeID(NewID) EmployeeID = NewID End Sub 2

Mark scheme, page 10

9608/42 Cambridge International AS/A Level – Mark Scheme PUBLISHED October/November 2019 © UCLES 2019 Page 10 of 20 Question Answer Marks 1(c)(v) 1 mark per bullet point • Set method/function header and close (where needed) with parameter • Checking value of parameter for both true and false « • « If valid – setting Pension to parameter and returning True • « If not valid – not setting Pension and returning False Example code: Pascal Function salaryEmployee.SetPension(NewPension) : boolean; IF NewPension = true or NewPension = false THEN Pension := NewPension; Result := true; ELSE Result := false; end; Python def SetPension(self, NewPension): if NewPension == True Or NewPension == False: self.__Pension = NewPension return True else: return False VB.NET Public Function SetPension(NewPension) AS Boolean If NewPension = True Or NewPension = False Then Pension = NewPension Return True Else Return False End If End Function 4

Mark scheme, page 11

9608/42 Cambridge International AS/A Level – Mark Scheme PUBLISHED October/November 2019 © UCLES 2019 Page 11 of 20 Question Answer Marks 1(c)(vi) 1 mark per bullet point to max 8 • Function header and close (where needed) with at least one parameter • Constants used for hours bonus, month bonus, holiday bonus, pension cost(at least 3) • Checking if Hours is > = 160, calculating bonus payment (monthlypay * 0.05) • Checking if pension is true, calculation pension to pay (monthlypay * 0.04) • Checking if public holiday is true, calculation of bonus payment (monthlypay * 0.03) • « all 3 Hours, Pension and PublicHoliday accessed from the parameter using Get methods • Adding both bonus payments to basic salary and deducting pension from salary • « basic salary accessed by using GetMonthlyPayment with the parameter • Outputting the total final bonus and pension with appropriate message • Returning the new salary Example code: Pascal Function CalculateMonthlySalary(TheEmployee : SalaryEmployee) : real; var BonusPayment : real; PensionPayment : real; BasicSalary : real; const HoursBonus : real = 0.05; HoursMonthBonus : integer = 160; PensionCost : real = 0.04; PublicHolidayBonus : real = 0.03; begin BonusPayment :=0; PensionPayment :=0; BasicSalary :=0; 8

Mark scheme, page 12

9608/42 Cambridge International AS/A Level – Mark Scheme PUBLISHED October/November 2019 © UCLES 2019 Page 12 of 20 Question Answer Marks 1(c)(vi) BasicSalary := TheEmployee.GetMonthlyPayment(); IF TheEmployee.GetHoursThisMonth() >= HoursMonthBonus THEN BonusPayment := BasicSalary * HoursBonus; IF TheEmployee.GetPension() = True THEN PensionPayment := BasicSalary * PensionCost; IF TheEmployee.GetPublicHoliday() = True THEN BonusPayment := BonusPayment + BasicSalary * PublicHolidayBonus; writeln("The pension payment is " & PensionPayment); writeln ("The bonus payment is " & BonusPayment); MonthlySalary := BasicSalary + BonusPayment - PensionPayment; result := MonthlySalary; end; Python def CalculateMonthlySalary(TheEmployee): BonusPayment = 0 PensionPayment = 0 HoursBonus = 0.05 HoursMonthBonus = 160 PensionCost = 0.04 PublicHolidayBonus = 0.03 BasicSalary = TheEmployee.GetMonthlyPayment() if TheEmployee.GetHoursThisMonth() >= HoursMonthBonus: BonusPayment = BasicSalary * HoursBonus

Mark scheme, page 13

9608/42 Cambridge International AS/A Level – Mark Scheme PUBLISHED October/November 2019 © UCLES 2019 Page 13 of 20 Question Answer Marks 1(c)(vi) if TheEmployee.GetPension() == true: PensionPayment = BasicSalary * PensionCost if TheEmployee.GetPublicHoliday() == true: BonusPayment = BonusPayment + BasicSalary * PublicHolidayBonus print("The pension payment is ", str(PensionPayment)) print("The bonus payment is ", str(BonusPayment)) MonthlySalary = BasicSalary + BonusPayment - PensionPayment return MonthlySalary VB.NET Public Function CalculateMonthlySalary(TheEmployee As SalaryEmployee) As Double Dim BonusPayment As Single = 0 Dim PensionPayment As Single = 0 Dim MonthlySalary As Single = 0 Const HoursBonus As Single = 0.05 Const HoursMonthBonus As Integer = 160 Const PensionCost As Single = 0.04 Const PublicHolidayBonus As Single = 0.03 Dim BasicSalary As Double = TheEmployee.GetMonthlyPayment() If TheEmployee.GetHoursThisMonth() >= HoursMonthBonus Then BonusPayment = BasicSalary * HoursBonus End If If TheEmployee.GetPension() = True Then PensionPayment = BasicSalary * PensionCost End If If TheEmployee.GetPublicHoliday() = True Then BonusPayment = BonusPayment + BasicSalary * PublicHolidayBonus End If

Mark scheme, page 14

9608/42 Cambridge International AS/A Level – Mark Scheme PUBLISHED October/November 2019 © UCLES 2019 Page 14 of 20 Question Answer Marks 1(c)(vi) Console.WriteLine("The pension payment is " & PensionPayment) Console.WriteLine("The bonus payment is " & BonusPayment) MonthlySalary = BasicSalary + BonusPayment - PensionPayment Return MonthlySalary End Function 1(d) Polymorphism 1

Mark scheme, page 15

9608/42 Cambridge International AS/A Level – Mark Scheme PUBLISHED October/November 2019 © UCLES 2019 Page 15 of 20 Question Answer Marks 2(a) 1 mark per completed statement FUNCTION AddToQueue(Number : INTEGER) RETURNS BOOLEAN CONSTANT FirstIndex = 0 CONSTANT LastIndex = 7 TempPointer ← EndPointer + 1 IF TempPointer > LastIndex THEN TempPointer ← FirstIndex ENDIF IF TempPointer = StartPointer THEN RETURN FALSE ELSE EndPointer ← TempPointer NumberQueue[EndPointer] ← Number RETURN TRUE ENDIF ENDFUNCTION 5 2(b) 1 mark per bullet point 1 mark for: • « if the start pointer reaches the end of the queue, it becomes the index of the first element in the queue Max 3 from: • Checks if the circular queue is empty // Checks if the queue has any data in it • « if it is empty it reports that it is empty • If not empty, return the value at the position of the start pointer « • « then increments the start pointer 4

Mark scheme, page 16

9608/42 Cambridge International AS/A Level – Mark Scheme PUBLISHED October/November 2019 © UCLES 2019 Page 16 of 20 Question Answer Marks 2(c) 1 mark per bullet point to max 3 e.g. • Stack • Linked list • Dictionary • (Binary) tree 3 Question Answer Marks 3(a) 1 mark per test data type • Normal / valid • Abnormal / erroneous / invalid • Boundary / extreme 3 3(b)(i) 1 mark for each name Description Name of debugging feature A point where the program can be halted to see if the program works to this point Breakpoint One statement is executed and then the program waits for input from the programmer to move to the next statement. Stepping // step through/over/into 2 3(b)(ii) 1 mark for name, 1 for description e.g. • variable watch window • observe how variables change during execution // view current status of variables • Error list • describes the error // gives line number of error 2

Mark scheme, page 17

9608/42 Cambridge International AS/A Level – Mark Scheme PUBLISHED October/November 2019 © UCLES 2019 Page 17 of 20 Question Answer Marks 4 1 mark for each correct transition with arrow. 8 ATM active Waiting for PIN Checking PIN Account accessed Checking account Transaction complete Transaction cancelled Start Insert card Enter Pin Input amount to withdraw Return card and dispense cash Funds not available

Mark scheme, page 18

9608/42 Cambridge International AS/A Level – Mark Scheme PUBLISHED October/November 2019 © UCLES 2019 Page 18 of 20 Question Answer Marks 5(a) 1 mark for each shaded section • LDD NUMBER • LSL • #2 • STO NUMBER • END Label Op code Operand Comment LDD NUMBER // load contents of NUMBER LSL #2 // perform shift to multiply by 4 STO NUMBER // store contents of ACC in NUMBER END // end program NUMBER: B00110110 5

Mark scheme, page 19

9608/42 Cambridge International AS/A Level – Mark Scheme PUBLISHED October/November 2019 © UCLES 2019 Page 19 of 20 Question Answer Marks 5(b) Label Op code Operand Comment LDR #0 // initialise index register to 0 START: LDX STRING // load the next value from STRING 1 AND MASK // bitwise AND operation with MASK 1 CMP MASK // check if result equals MASK 1 JPN UPPER // if FALSE jump to UPPER 1 LDD COUNT // increment COUNT 1 INC ACC STO COUNT UPPER: INC IX // increment Index Register 1 LDD LENGTH // decrement LENGTH 1 DEC ACC STO LENGTH CMP #0 // is LENGTH = 0 ? 1 JPN START // if FALSE, jump to START 1 END // end program 8

Mark scheme, page 20

9608/42 Cambridge International AS/A Level – Mark Scheme PUBLISHED October/November 2019 © UCLES 2019 Page 20 of 20 Question Answer Marks 5(b) MASK: B00100000 // if bit 5 is 1, letter is lower case COUNT: 0 LENGTH: 5 STRING: B01001000 // The ASCII code for 'H' B01100001 // The ASCII code for 'a' B01110000 // The ASCII code for 'p' B01110000 // The ASCII code for 'p' B01011001 // The ASCII code for 'Y'

What you needed in this session

Cambridge’s own grade thresholds for 2019 Oct/Nov, Paper 4 · Variant 2. A higher threshold means an easier paper — the bar moves with how the cohort did.

A57/75
B48/75
C41/75
D35/75
E28/75