Cambridge A Level Computer Science 9608 — 2019 May/June Paper 4 · Variant 2
9608/42/M/J/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.
Question paper20 pages




















Mark scheme21 pages
Answers below. Sit the paper first if you are practising.





















Paper as text
Question paper, page 1
This document consists of 19 printed pages and 1 blank page. DC (ST/CT) 163579/2 © UCLES 2019 [Turn over Cambridge Assessment International Education Cambridge International Advanced Subsidiary and Advanced Level * 9 9 6 1 2 1 5 4 3 6 * COMPUTER SCIENCE 9608/42 Paper 4 Further Problem-solving and Programming Skills May/June 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.
Question paper, page 2
2 9608/42/M/J/19 © UCLES 2019 1 A company wants an online marking system for an examination. (a) The following is a selection of data showing final marks. 36, 45, 21, 65, 66, 13, 54, 53, 34 A linked list of nodes will be used to store the data. Each node consists of the data, a left pointer and a right pointer. The linked list will be organised as a binary tree. (i) Complete the binary tree to show how the data above will be organised. 45 Ø 65 21 36 66 Ø Ø RootPointer LeftPointer RightPointer The symbol Ø represents a null pointer [5]
Question paper, page 3
3 9608/42/M/J/19 © UCLES 2019 [Turn over (ii) The following diagram shows a 2D array that stores the nodes of the binary tree’s linked list. Add the correct pointer values to complete the diagram, using your answer from part (a)(i). Index LeftPointer Data RightPointer 0 36 1 45 2 21 3 65 4 66 5 13 6 54 7 53 8 34 9 [6] 0 RootPointer FreePointer
Question paper, page 4
4 9608/42/M/J/19 © UCLES 2019 (b) The company wants to implement a program for the marking system. It will do this with object-oriented programming (OOP). Many candidates take the examination. Each examination paper is given a PaperID that is made up of the centre (school) number followed by the candidate number. Each examination paper is awarded a grade. The following diagram shows the design for the ExaminationPaper class. This includes the attributes and methods. ExaminationPaper FinalMark : INTEGER // maximum 2 digits, initialised to 0 Grade : STRING // "Pass", "Merit", "Distinction" // or "Fail", initialised to "Fail" PaperID : STRING // centre number followed by the // candidate number, for example // "ZZ00991001" Create() // creates and initialises a new instance // of the ExaminationPaper class using // language-appropriate constructor SetFinalMark() // checks that the mark parameter has a // valid value, if so, assigns it to // FinalMark SetGrade() // sets Grade based on FinalMark GetFinalMark() // returns FinalMark GetGrade() // returns Grade GetPaperID() // returns PaperID
Question paper, page 5
5 9608/42/M/J/19 © UCLES 2019 [Turn over (i) The constructor receives the centre number and candidate number as parameter values to create PaperID. Other properties are initialised as instructed in the class diagram. Write program code for the Create() constructor method. Programming language … Program code … … … … … … … … … … [5] (ii) Get and set methods are used to support the security and integrity of data in object-oriented programming. Explain how get and set methods are used to support security and integrity. … … … … … … [3]
Question paper, page 6
6 9608/42/M/J/19 © UCLES 2019 (iii) Write program code for the following three get methods. Programming language … GetFinalMark() Program code … … … … GetGrade() Program code … … … … GetPaperID() Program code … … … … [4]
Question paper, page 7
7 9608/42/M/J/19 © UCLES 2019 [Turn over (iv) The method SetFinalMark() checks that its INTEGER parameter Mark is valid. It is then set as the final mark if it is valid. A valid mark is greater than or equal to 0 and less than or equal to 90. If the mark is valid, the method sets the final mark and returns TRUE. If the mark is not valid, the method does not set the final mark and returns FALSE. Write program code for SetFinalMark(Mark : INTEGER). Programming language … Program code … … … … … … … … … … [5]
Question paper, page 8
8 9608/42/M/J/19 © UCLES 2019 (v) Write program code for the method: SetGrade(DistMark, MeritMark, PassMark : INTEGER) Use the properties in the original class definition. Grades are awarded as follows: Grade Criteria Distinction >= DistMark Merit >= MeritMark Pass >= PassMark Fail < PassMark Programming language … Program code … … … … … … … … … … … … … … [4]
Question paper, page 9
9 9608/42/M/J/19 © UCLES 2019 [Turn over (vi) Emily is a candidate who has taken the examination paper. The grades are awarded as follows: Grade Criteria Distinction >= 80 Merit >= 70 Pass >= 55 The procedure Main() performs the following tasks. • allows the centre number, candidate number and mark to be input, with suitable prompts • assigns an instance of ExaminationPaper to the variable ThisPaper • sets the mark for the object • sets the grade for the object • outputs the grade for the object Write program code for the Main() procedure. Programming language … Program code … … … … … … … … … … … … … … … … [8]
Question paper, page 10
10 9608/42/M/J/19 © UCLES 2019 (c) The examination paper will be taken by many candidates in centres around the world. The program stores the objects of the ExaminationPaper class in a file. The company has decided to use a hash table, rather than a linked list to store the objects. Explain why a hash table is more suitable than a linked list to store the objects. … … … … … … … … [4]
Question paper, page 11
11 9608/42/M/J/19 © UCLES 2019 [Turn over Question 2 begins on the next page.
Question paper, page 12
12 9608/42/M/J/19 © UCLES 2019 2 A stack is an Abstract Data Type (ADT). (a) Tick (3) one box to show the statement that describes a stack data structure. Statement Tick (3) Last in first out First in first out Last in last out [1] (b) A stack contains the values 20, 35, 43, 55. 55 43 35 20 (i) Show the contents of the stack in part (b) after the following operations. POP() POP() PUSH(10) [1] Top of stack
Question paper, page 13
13 9608/42/M/J/19 © UCLES 2019 [Turn over (ii) Show the contents of the stack from part (b)(i) after these further operations: POP() PUSH(50) PUSH(55) POP() PUSH(65) [1]
Question paper, page 14
14 9608/42/M/J/19 © UCLES 2019 (iii) The stack is implemented as a 1D array, with eight elements, and given the identifier ArrayStack. The global variable Top contains the index of the last element in the stack, or −1 if the stack is empty. The function Push(): • takes as a parameter an INTEGER value to place on the stack • adds the value to the top of the stack and returns TRUE to show that the operation was successful • returns FALSE if the stack is full. Write an algorithm in pseudocode for the function Push(). … … … … … … … … … … … … … … … … [7]
Question paper, page 15
15 9608/42/M/J/19 © UCLES 2019 [Turn over 3 (a) Identify and describe two features of an editor that can help a programmer to write program code. Feature 1 … Description … … … Feature 2 … Description … … … [4] (b) A programmer can use three types of test data when testing a program. Identify the three different types of test data. 1 … 2 … 3 … [3]
Question paper, page 16
16 9608/42/M/J/19 © UCLES 2019 4 (a) A program has sorted some data in the array, List, in ascending order. The following binary search algorithm is used to search for a value in the array. 01 ValueFound FALSE 02 UpperBound LengthOfList - 1 03 LowerBound 0 04 NotInList FALSE 05 06 WHILE ValueFound = FALSE AND NotInList = FALSE 07 MidPoint ROUND((LowerBound + UpperBound) / 2) 08 09 IF List[LowerBound] = SearchValue 10 THEN 11 ValueFound TRUE 12 ELSE 13 IF List[MidPoint] < SearchValue 14 THEN 15 UpperBound MidPoint + 1 16 ELSE 17 UpperBound MidPoint – 1 18 ENDIF 19 IF LowerBound > MidPoint 20 THEN 21 NotInList TRUE 22 ENDIF 23 ENDIF 24 ENDWHILE 25 26 IF ValueFound = FALSE 27 THEN 28 OUTPUT "The value is in the list" 29 ELSE 30 OUTPUT "The value is not found in the list" 31 ENDIF Note: The pseudocode function ROUND(Reall : REAL) RETURNS INTEGER rounds a number to the nearest integer value. For example: ROUND(4.5) returns 5 and ROUND(4.4) returns 4
Question paper, page 17
17 9608/42/M/J/19 © UCLES 2019 [Turn over (i) There are four errors in the algorithm. Write the line of code where an error is present and write the correction in pseudocode. Error 1 … Correction … Error 2 … Correction … Error 3 … Correction … Error 4 … Correction … [4] (ii) A binary search is one algorithm that can be used to search an array. Identify another searching algorithm. … [1]
Question paper, page 18
18 9608/42/M/J/19 © UCLES 2019 (b) The following is an example of a sorting algorithm. It sorts the data in the array ArrayData. 01 TempValue "" 02 REPEAT 03 Sorted TRUE 04 FOR Count 0 TO 4 05 IF ArrayData[Count] > ArrayData[Count + 1] 06 THEN 07 TempValue ArrayData[Count + 1] 08 ArrayData[Count + 1] ArrayData[Count] 09 ArrayData[Count] TempValue 10 Sorted FALSE 11 ENDIF 12 ENDFOR 13 UNTIL Sorted = TRUE (i) Complete the trace table for the algorithm given in part (b), for the ArrayData values given in the table. Count TempValue Sorted ArrayData 0 1 2 3 4 5 5 20 12 25 32 29 [4]
Question paper, page 19
19 9608/42/M/J/19 © UCLES 2019 (ii) Rewrite lines 4 to 12 of the algorithm in part (b) using a WHILE loop instead of a FOR loop. … … … … … … … … … … … … … … … … [3] (iii) Identify the algorithm shown in part (b). … [1] (iv) Identify another sorting algorithm. … [1]
Question paper, page 20
20 9608/42/M/J/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 21 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 May/June 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 May/June 2019 series for most Cambridge IGCSE™, Cambridge International A and AS Level and Cambridge Pre-U components, and some Cambridge O Level components.
Mark scheme, page 2
9608/42 Cambridge International AS/A Level – Mark Scheme PUBLISHED May/June 2019 © UCLES 2019 Page 2 of 21 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. 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).
Mark scheme, page 3
9608/42 Cambridge International AS/A Level – Mark Scheme PUBLISHED May/June 2019 © UCLES 2019 Page 3 of 21 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 May/June 2019 © UCLES 2019 Page 4 of 21 Question Answer Marks 1(a)(i) 1 mark per bullet point • 13 to left of 21 • 34 to right of 21 • 54 to left of 65 • 53 to left of 54 • Null and other pointers on all boxes written and no other pointers filled in 5
Mark scheme, page 5
9608/42 Cambridge International AS/A Level – Mark Scheme PUBLISHED May/June 2019 © UCLES 2019 Page 5 of 21 Question Answer Marks 1(a)(ii) 1 mark per bullet point • FreePointer • 36 • 45 • 21 and 65 • 66 and 13 • 54, 53 and 34 RootPointer Index LeftPointer Data RightPointer 0 [0] 2 36 1 [1] null 45 3 FreePointer [2] 5 21 8 9 [3] 6 65 4 [4] null 66 null [5] null 13 null [6] 7 54 null [7] null 53 null [8] null 34 null [9] 6
Mark scheme, page 6
9608/42 Cambridge International AS/A Level – Mark Scheme PUBLISHED May/June 2019 © UCLES 2019 Page 6 of 21 Question Answer Marks 1(b)(i) 1 mark per bullet point • Language specific constructor header and close (where appropriate) • «with two parameters (variables) • Initialise FinalMark to 0 • Initialise Grade to "Fail" • Initialise PaperID to CentreNumber + CandidateNumber PYTHON def__init__(self, CentreNumber,CandidateNumber): self.__FinalMark = 0 self.__Grade = "Fail" self.__PaperID = CentreNumber + CandidateNumber PASCAL Contructor NewExaminationPaper.Create(CentreNumber : String, CandidateNumber : String); begin FinalMark := 0; Grade := 'Fail'; PaperID := CentreNumber + CandidateNumber; end; VB Public Sub New (ByVal CentreNumber As String, ByVal CandidateNumber As String) FinalMark = 0 Grade = "Fail" PaperID = CentreNumber & CandidateNumber End Sub 5
Mark scheme, page 7
9608/42 Cambridge International AS/A Level – Mark Scheme PUBLISHED May/June 2019 © UCLES 2019 Page 7 of 21 Question Answer Marks 1(b)(ii) 1 mark per bullet point to max 3 • Used to access/change the properties/attributes • «only using the get/set methods • «that are set to private • Provide encapsulation • Prevents accidental change • To make sure data is valid // act as validation • Hides data • The get methods allow the data to be accessed/returned • The set methods allow the data to be changed/written to 3
Mark scheme, page 8
9608/42 Cambridge International AS/A Level – Mark Scheme PUBLISHED May/June 2019 © UCLES 2019 Page 8 of 21 Question Answer Marks 1(b)(iii) 1 mark per bullet point • 1 get method header without parameter (returning string where appropriate) • «returning the property • A second working Get • A third working Get PYTHON def GetFinalMark(): return (FinalMark) def GetGrade(): return (Grade) def GetPaperID(): return (PaperID) PASCAL function GetFinalMark():Integer; begin GetFinalMark:= FinalMark; end; function GetGrade():String; begin GetGrade:= Grade; end; function GetPaperID():string; begin GetPaperID:= PaperID; end; 4
Mark scheme, page 9
9608/42 Cambridge International AS/A Level – Mark Scheme PUBLISHED May/June 2019 © UCLES 2019 Page 9 of 21 Question Answer Marks 1(b)(iii) VB Public Function GetFinalMark() As Integer Return FinalMark End Function Public Function GetGrade() As String Return Grade End Function Public Function GetPaperID() As String Return PaperID End Function
Mark scheme, page 10
9608/42 Cambridge International AS/A Level – Mark Scheme PUBLISHED May/June 2019 © UCLES 2019 Page 10 of 21 Question Answer Marks 1(b)(iv) 1 mark per bullet point • Set header taking parameter and close (where appropriate • check if parameter >= 0 and <= 90 • If valid (>=0 and <=90) return TRUE • «and set FinalMark to parameter • If not valid, return FALSE and do not set FinalMark PYTHON def SetFinalMark (Mark): if Mark >=0 and Mark <=90: IsValid = True FinalMark = Mark else: IsValid = False return(IsValid) PASCAL function SetFinalMark (Mark: Integer) : Boolean; var IsValid : Boolean; begin If (Mark >=0) AND (Mark <=90) Then FinalMark := Mark; IsValid := True; Else IsValid :=False; end; 5
Mark scheme, page 11
9608/42 Cambridge International AS/A Level – Mark Scheme PUBLISHED May/June 2019 © UCLES 2019 Page 11 of 21 Question Answer Marks 1(b)(iv) VB Public Function SetFinalMark(ByVal Mark As Integer) As Boolean If (Mark >=0) And (Mark <=90) Then FinalMark = Mark Return True Else Return False End If End Function
Mark scheme, page 12
9608/42 Cambridge International AS/A Level – Mark Scheme PUBLISHED May/June 2019 © UCLES 2019 Page 12 of 21 Question Answer Marks 1(b)(v) 1 mark per bullet point • Procedure header with three parameters (and close where appropriate) • Check if FinalMark is >= DistMark and Grade set to Distinction • Check if FinalMark is >= MeritMark and <DistMark and Grade set to Merit Check if FinalMark is >= PassMark and <MeritMark and Grade set to Pass • Otherwise Grade set to Fail PYTHON def SetGrade(DistMark, MeritMark, PassMark): if FinalMark >= DistMark: Grade = "Distinction" elif FinalMark >= MeritMark: Grade = "Merit" elif FinalMark >= PassMark: Grade = "Pass" else: Grade = "Fail" PASCAL procedure SetGrade(DistMark, MeritMark, PassMark) begin If FinalMark >= DistMark Then Grade := "Distinction"; Else If FinalMark >= MeritMark Then Grade := "Merit"; Else If FinalMark >= PassMark Then Grade:= "Pass"; Else Grade:= "Fail"; end; 4
Mark scheme, page 13
9608/42 Cambridge International AS/A Level – Mark Scheme PUBLISHED May/June 2019 © UCLES 2019 Page 13 of 21 Question Answer Marks 1(b)(v) VB Public Sub SetGrade(DistMark, MeritMark, PassMark) If FinalMark >= DistMark Then Grade = "Distinction" ElseIf FinalMark >= MeritMark Then Grade = "Merit" ElseIf FinalMark >= PassMark Then Grade = "Pass" Else Grade = "Fail" End If End Sub
Mark scheme, page 14
9608/42 Cambridge International AS/A Level – Mark Scheme PUBLISHED May/June 2019 © UCLES 2019 Page 14 of 21 Question Answer Marks 1(b)(vi) 1 mark per bullet point to max 8 • Procedure Main header and close (where appropriate) • Input candidate number, centre number and mark with suitable prompt(s) • Create instance of ExaminationPaper named ThisPaper« • « with input parameters candidate number and centre number • Call SetFinalMark for ThisPaper with mark input as parameter • «storing/using return value • «outputting a message if this is valid or invalid • Call SetGrade for ThisPaper with correct thresholds • Output grade for ThisPaper « • «using .GetGrade PYTHON def main(): candidateNumber = input("Please enter the candidate number") centreNumber = input("Please enter the centre number") mark = input("Please enter the mark") ThisPaper = ExaminationPaper(centreNumber, candidateNumber) if ThisPaper.SetFinalMark(mark) == FALSE: print("Invalid mark") else: ThisPaper.SetGrade(80, 70, 55) print(ThisPaper.GetGrade()) 8
Mark scheme, page 15
9608/42 Cambridge International AS/A Level – Mark Scheme PUBLISHED May/June 2019 © UCLES 2019 Page 15 of 21 Question Answer Marks 1(b)(vi) PASCAL procedure Main(); var candidateNumber, centreNumber : String; isValid : boolean; thisPaper : ExaminationPaper; mark : integer; begin Writeln(Enter candidate number: '); Readln(candidateNumber); Writeln('Enter centre number: '); Readln(centreNumber); ThisPaper := ExaminationPaper.Create(centreNumber, candidateNumber); Writeln('Enter mark: '); Readln(mark); isValid := ThisPaper.SetFinalMark(mark); if isValid = true: thisPaper.SetGrade(80, 70, 55); Writeln(ThisPaper.GetGrade()); else: Writeln("Invalid mark") end;
Mark scheme, page 16
9608/42 Cambridge International AS/A Level – Mark Scheme PUBLISHED May/June 2019 © UCLES 2019 Page 16 of 21 Question Answer Marks 1(b)(vi) VB Sub main() Dim candidateNumber As String Dim centreNumber As String Console.WriteLine("Please enter the candidate number") candidateNumber = Console.ReadLine() Console.WriteLine("Please enter the centre number") centreNumber = Console.ReadLine() Dim ThisPaper As New ExaminationPaper(centreNumber, candidateNumber) Dim IsValid As Boolean Console.WriteLine("Please enter the mark") Dim mark As Integer mark = Console.ReadLine() IsValid = ThisPaper.SetFinalMark(mark) if IsValid = True then ThisPaper.SetGrade(80, 70, 55) Console.WriteLine(ThisPaper.GetGrade()) else Console.WriteLine("Invalid mark") endif End Sub 1(c) 1 mark per bullet point to max 4 • There are a large number of objects/records to store // hash is better for a large number of objects/records • A hashing algorithm/hash performed on key field/record (to form the address) • «to allow direct access to the object • «so it is likely to be faster in finding the object // linked list is slower in finding the object • In a linked list, each object needs to be checked until found // sequentially/linear accessed • «the left/right/next pointer is followed // have to trace pointers 4
Mark scheme, page 17
9608/42 Cambridge International AS/A Level – Mark Scheme PUBLISHED May/June 2019 © UCLES 2019 Page 17 of 21 Question Answer Marks 2(a) 1 mark for correct tick Statement Tick (9) Last in first out 9 First in first out Last in last out 1 2(b)(i) 1 mark for correct stack 10 35 20 1 2(b)(ii) 1 mark for correct stack 65 50 35 20 1
Mark scheme, page 18
9608/42 Cambridge International AS/A Level – Mark Scheme PUBLISHED May/June 2019 © UCLES 2019 Page 18 of 21 Question Answer Marks 2(b)(iii) 1 mark for each bullet • Function Push « • «taking parameter (returning Boolean) • Checking if Top = 7 « • «returning FALSE if full • «returning TRUE otherwise • if not full, increment Top • ... add parameter to Top of ArrayStack FUNCTION Push (BYVALUE DataItem : Integer) (RETURNS Boolean) IF Top = 7 THEN RETURN FALSE ELSE Top ← Top + 1 ArrayStack[Top] ← DataItem RETURN TRUE ENDIF ENDFUNCTION 7
Mark scheme, page 19
9608/42 Cambridge International AS/A Level – Mark Scheme PUBLISHED May/June 2019 © UCLES 2019 Page 19 of 21 Question Answer Marks 3(a) 1 mark for name of feature; 1 mark for description e.g. • Colouring code//Pretty printing • This is how the code is presented in the IDE e.g. colour coding and indentation • Context-sensitive prompts • Displays keywords or hints at the point of insertion e.g. drop-down list of commands • Auto-indent • Automatically indent your code for selection/iteration/procedures/methods • Auto-complete • Avoid typing errors // speeds up process of typing • Expand/collapse subroutines/code • To make it easier to view code currently working on 4 3(b) 1 mark per each correct bullet point • Normal • Abnormal / erroneous / invalid • Boundary / extreme 3
Mark scheme, page 20
9608/42 Cambridge International AS/A Level – Mark Scheme PUBLISHED May/June 2019 © UCLES 2019 Page 20 of 21 Question Answer Marks 4(a)(i) 1 mark for error and correction Error 1 – IF List[LowerBound] = SearchValue Correction – IF List[MidPoint] = SearchValue Error 2 – UpperBound ← MidPoint + 1 Correction – LowerBound ← MidPoint + 1 Error 3 – IF LowerBound > MidPoint Correction - IF LowerBound > UpperBound Error 4 – IF ValueFound = FALSE Correction – IF ValueFound = TRUE 4 4(a)(ii) Linear search 1 4(b)(i) 1 mark per shaded section Count TempValue Sorted ArrayData 0 1 2 3 4 5 0 "" TRUE 5 20 12 25 32 29 1 12 FALSE 12 20 2 3 4 29 (FALSE) 29 32 0 TRUE 1 2 3 4 4
Mark scheme, page 21
9608/42 Cambridge International AS/A Level – Mark Scheme PUBLISHED May/June 2019 © UCLES 2019 Page 21 of 21 Question Answer Marks 4(b)(ii) 1 mark per bullet point • Initialising a counter variable to 0 and must be the same variable used to access array elements • While loop checking counter is < 5 or <= 4 • Incrementing counter inside the loop and outside IF, and remainder of algorithm completed (The IF to ENDIF) e.g. Count ← 0 WHILE Count < 5 IF ArrayData[Count] > ArrayData[Count + 1] THEN TempValue ← ArrayData[Count + 1] ArrayData[Count + 1] ← ArrayData[Count] ArrayData[Count] ← TempValue Sorted ← False ENDIF Count ← Count + 1 ENDWHILE 3 4(b)(iii) Bubble sort 1 4(b)(iv) One from: • Insertion sort • Merge sort • Quick sort 1
What you needed in this session
Cambridge’s own grade thresholds for 2019 May/June, Paper 4 · Variant 2. A higher threshold means an easier paper — the bar moves with how the cohort did.