Cambridge A Level Computer Science 9618 — 2024 Oct/Nov Paper 2 · Variant 1
9618/21/O/N/24 · 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 scheme13 pages
Answers below. Sit the paper first if you are practising.













Paper as text
Question paper, page 1
This document has 20 pages. Any blank pages are indicated. [Turn over * 0 2 8 5 5 0 0 1 8 0 * Cambridge International AS & A Level COMPUTER SCIENCE 9618/21 Paper 2 Fundamental Problem-solving and Programming Skills October/November 2024 2 hours You must answer on the question paper. You will need: Insert (enclosed) INSTRUCTIONS ● Answer all questions. ● Use a black or dark blue pen. ● Write your name, centre number and candidate number in the boxes at the top of the page. ● Write your answer to each question in the space provided. ● Do not use an erasable pen or correction fluid. ● Do not write on any bar codes. ● You may use an HB pencil for any diagrams, graphs or rough working. ● Calculators must not be used in this paper. INFORMATION ● The total mark for this paper is 75. ● The number of marks for each question or part question is shown in brackets [ ]. ● No marks will be awarded for using brand names of software packages or hardware. ● The insert contains all the resources referred to in the questions. DC (DE/FC) 336146/4 © UCLES 2024 , , * 0000800000001 * ¬W. 4mHuOªE_z5W ¬i9|R£^sI=ty§ ¥u Uu5e5¥5EEE5¥UU
Question paper, page 2
2 9618/21/O/N/24 © UCLES 2024 Refer to the insert for the list of pseudocode functions and operators. 1 A program will calculate the tax payable based on the cost of an item. Calculations will occur at many places in the program and these involve the use of one of three tax rates. Tax rate values represent a percentage. For example, a tax rate value of 5.23 represents 5.23%. In this case, the tax payable on an item costing $100 would be $5.23. Tax rate values are used at several places within the program. One example is given in pseudocode as follows: HighRate ← FALSE CASE OF ItemCost <= 50 : TaxRate ← 3.75 // tax rate of 3.75% <= 200 : TaxRate ← 5.23 // tax rate of 5.23% > 200 : TaxRate ← 6.25 // tax rate of 6.25% HighRate ← TRUE ENDCASE TaxPayable ← ItemCost * TaxRate // tax payable (a) The pseudocode contains a logical error. Identify the error and suggest a correction. Error … … Correction … … [2] (b) During the design of the program, tax rate values have been used wherever they are needed as shown in the pseudocode example above. Tax rates do not change while the program runs. (i) Identify a more appropriate way of representing the tax rate values in the final program. … [1] (ii) Describe the benefits of your answer to part (b)(i) with reference to this program. … … … … … … [3] * 0000800000002 * , , ĬÕĊ®Ġ´íÈõÏĪÅĊÞü·þ× Ĭé»ûÓĩĚąÕîąæõĊëÁğĂ ĥåĕÕµÕĥÕÕõĕąÅõąÕõÕ DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN
Question paper, page 3
3 9618/21/O/N/24 © UCLES 2024 [Turn over (c) Give the appropriate data type for the variables in the following table, as used in the pseudocode: Variable name Data type HighRate TaxPayable [2] (d) The final CASE condition (> 200) in the pseudocode example could be replaced with a keyword. Give the keyword. … [1] * 0000800000003 * , , Ĭ×Ċ®Ġ´íÈõÏĪÅĊÞú·þ× Ĭé¼üÛğĖõäČüģáòïÁďĂ ĥåĥĕõµąµÅąÅąÅĕĥĕĥÕ DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN
Question paper, page 4
4 9618/21/O/N/24 © UCLES 2024 2 A program uses three global integer variables HH, MM and SS to represent the current time in hours, minutes and seconds using the 24-hour clock notation. Midnight would be represented as 00:00:00 (HH:MM:SS). If the variables HH, MM and SS contained the values 16, 30 and 10 respectively, then the time would be 16:30:10 or just after 4.30 in the afternoon. A procedure Tick() will be called every second. The procedure Tick() will: • update the value in SS each time it is called • update the values in HH and MM as appropriate • call a procedure CheckAlarm() at the start of each minute • call a procedure NewDay() whenever the time reaches midnight. Complete the pseudocode for procedure Tick(). PROCEDURE Tick() … … … … … … … … … … … … … … … … … … ENDPROCEDURE [6] * 0000800000004 * , , ĬÕĊ®Ġ´íÈõÏĪÅĊàü·Ā× Ĭé¼ùÛĥĨô×ĆóĬăÎÍÑħĂ ĥĕµĕµµąĕååµąąĕÅĕõÕ DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN
Question paper, page 5
5 9618/21/O/N/24 © UCLES 2024 [Turn over BLANK PAGE * 0000800000005 * , , Ĭ×Ċ®Ġ´íÈõÏĪÅĊàú·Ā× Ĭé»úÓģĬĄâôþÝ׿ĉÑėĂ ĥĕÅÕõÕĥõµÕĥąąõåÕĥÕ DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN
Question paper, page 6
6 9618/21/O/N/24 © UCLES 2024 3 An algorithm will output the last three lines from a text file Result.txt The lines need to be output in the same order as they appear in the file. Assume: • Three variables LineX, LineY and LineZ will store the three lines. These are of type string and all three variables have been initialised to an empty string. • The file exists and contains at least three lines. (a) The algorithm to output the lines is expressed in eight steps. Complete the steps. 1. Open the file … 2. Loop until … 3. … and store in ThisLine 4. Assign LineY to LineX 5. Assign LineZ to LineY 6. Assign ThisLine to LineZ 7. After the loop, … 8. Output LineX, LineY, LineZ [4] (b) Explain the purpose of steps 4, 5 and 6 in the algorithm from part (a). … … … [1] * 0000800000006 * , , ĬÙĊ®Ġ´íÈõÏĪÅĊÝú¶þ× Ĭé¼úÐĩĄĊê÷ïØ·ÎĬùħĂ ĥÅĥÕõõĥÕõµÅąÅõąĕµÕ DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN
Question paper, page 7
7 9618/21/O/N/24 © UCLES 2024 [Turn over (c) The requirement changes, and the algorithm will now output three lines from the file, starting from a given line number. The modified algorithm will be implemented as a function which will: • be called with an integer parameter representing the given line number • output three lines, starting at the given line • return TRUE if the 3 lines are output, or FALSE if it was not possible to output the 3 lines. Describe the changes that need to be made to steps 2 to 8 of the algorithm given in part (a). … … … … … … … … … … [4] * 0000800000007 * , , ĬÛĊ®Ġ´íÈõÏĪÅĊÝü¶þ× Ĭé»ùØğĀúÏāĂđģæ°ùėĂ ĥÅĕĕµĕąµĥÅĕąÅĕĥÕåÕ DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN
Question paper, page 8
8 9618/21/O/N/24 © UCLES 2024 4 A program includes the following assignment statement: Result ← STR_TO_NUM(x) / STR_TO_NUM(y) When the program evaluates the expression in the statement, it performs a calculation. Variable Result is of type real and variables x and y are of type string. Two checks are required before the calculation is performed: 1. The two strings represent valid numeric values. 2. The numeric value of string y is not zero. (a) Identify the type of error that could occur if these checks are not carried out and state a cause of this error. Type … … Cause … … [2] (b) The designer considers implementing the checks and calculation as a module (a procedure or a function). One reason for this is that the same checks and calculations are performed at several places in the program. Give another reason why this is a suitable approach and state what is avoided by this approach. Reason … … Avoided … … [2] * 0000800000008 * , , ĬÙĊ®Ġ´íÈõÏĪÅĊßú¶Ā× Ĭé»üØĥîïìÿĉĚÁĊĎĩğĂ ĥõÅĕõĕąĕąĥĥąąĕÅÕµÕ DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN
Question paper, page 9
9 9618/21/O/N/24 © UCLES 2024 [Turn over (c) The module to perform the checks and calculation will be implemented as a function. The function will need to return both a real and a Boolean value. To achieve this a record type is defined in pseudocode as follows: TYPE Result DECLARE Done : BOOLEAN DECLARE Value : REAL ENDTYPE The function Evaluate() will: • take two parameters of type string representing the two numeric values • return a variable of type Result with the Done field set to FALSE if either of the following applies: ◦ at least one of the strings does not represent a valid numeric value ◦ the numeric value of the string representing value y is zero • otherwise return a variable of type Result with the Done field set to TRUE and the Value field assigned the result of the formula (based on the numeric value of the two parameters). Write pseudocode for the function Evaluate(). … … … … … … … … … … … … … … … … … [6] * 0000800000009 * , , ĬÛĊ®Ġ´íÈõÏĪÅĊßü¶Ā× Ĭé¼ûÐģòÿÍùøÏĕòÊĩďĂ ĥõµÕµõĥõĕĕµąąõåĕåÕ DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN
Question paper, page 10
10 9618/21/O/N/24 © UCLES 2024 5 A software developer follows a program development life cycle. The life cycle divides the development process into various stages. (a) The following table lists some development activities. Complete the table by writing the name of the life cycle stage for each activity. Activity Name of life cycle stage The walkthrough method is used. An algorithm is implemented in a programming language. The client is interviewed about problems with the current system. The program is modified to run on new hardware. Records and file structures are defined. [5] (b) The program contains a validation function. (i) The function will: • take an integer value as a parameter • return TRUE if the value is within the range 24 to 37, inclusive • otherwise return FALSE. Complete the table to define a test plan to thoroughly test the operation of the function. Type of test data Test data value Expected result Normal 30 TRUE [4] (ii) The function is to be tested on its own. When it is shown to work correctly the function will be combined with other modules and testing will continue. Identify the type of testing that this represents. … [1] * 0000800000010 * , , ĬÙĊ®Ġ´íÈõÏĪÅĊÞú¸þ× ĬéºüÍħöĩæĈĂ´ÝČúÑėĂ ĥååÕõĕåĕåÕĥÅąµÅÕąÕ DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN
Question paper, page 11
11 9618/21/O/N/24 © UCLES 2024 [Turn over BLANK PAGE * 0000800000011 * , , ĬÛĊ®Ġ´íÈõÏĪÅĊÞü¸þ× Ĭé¹ûÕġúęÓòïõùôÞÑħĂ ĥåÕĕµõÅõµåµÅąÕåĕĕÕ DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN
Question paper, page 12
12 9618/21/O/N/24 © UCLES 2024 6 A factory produces food items. The items must be used within a certain number of days after their production date. The number of days is known as the shelf life. It is different for each type of item but is always a whole number in the range 1 to 21 (inclusive). The latest date that an item can be used is called the ‘use-by’ date. A program is needed to produce labels which show the ‘use-by’ date. Part of the program is a function GetDate() which will: • take two parameters: a production date and a value representing the shelf life • return the corresponding ‘use-by’ date. The program contains a global 1D array DaysInMonth of type integer which stores the number of days in each month (index 1 is January): Index Value 1 31 2 28 Note: Leap years are not considered 3 31 4 30 11 30 12 31 (a) An algorithm uses the array DaysInMonth to calculate a ‘use-by’ date. An alternative design would involve the use of multiple selection statements. An array-based technique is often used when there is a large number of different values to check and where no pattern exists. One advantage of using an array-based technique is the speed of execution compared to the use of multiple selection statements. Give two other advantages of using an array for this type of operation rather than a solution based on multiple selection statements. 1 … … 2 … … [2] * 0000800000012 * , , ĬÙĊ®Ġ´íÈõÏĪÅĊàú¸Ā× Ĭé¹úÕīČĐèðøîÛÐĀÁďĂ ĥĕąĕõõÅÕÕąÅÅÅÕąĕąÕ DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN
Question paper, page 13
13 9618/21/O/N/24 © UCLES 2024 [Turn over (b) Complete the pseudocode for the function GetDate(). Date functions from the insert should be used in your solution. FUNCTION GetDate(ProductionDate : DATE, ShelfLife : INTEGER) RETURNS DATE … … … … … … … … … … … … … … … … … … … … … … … … ENDFUNCTION [7] * 0000800000013 * , , ĬÛĊ®Ġ´íÈõÏĪÅĊàü¸Ā× ĬéºùÍĝĈĠÑĊĉ»ÿèÜÁğĂ ĥĕõÕµĕåµÅõĕÅŵĥÕĕÕ DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN
Question paper, page 14
14 9618/21/O/N/24 © UCLES 2024 7 A program contains six modules with headers as follows: Pseudocode module header PROCEDURE Connect() FUNCTION Activate(H1 : STRING, Code : INTEGER) RETURNS BOOLEAN FUNCTION Sync(T1 : BOOLEAN, S2 : REAL) RETURNS INTEGER PROCEDURE Initialise(BYREF ID : INTEGER, BYVAL CC : INTEGER) FUNCTION Reset(RA : STRING) RETURNS INTEGER FUNCTION Enable(SA : INTEGER) RETURNS BOOLEAN Module Connect() will call either Activate() or Sync(). This is decided at run-time. (a) Complete the structure chart for these modules. Connect T1 [5] (b) Explain the meaning of the curved arrow symbol used in the diagram in part (a). … … [2] * 0000800000014 * , , ĬÕĊ®Ġ´íÈõÏĪÅĊßûµĂ× Ĭé¹ûÐģûĘãĀþĘãíÐñħĂ ĥµõĕõõĥĕåĥĕąąõÅĕÅÕ DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN
Question paper, page 15
15 9618/21/O/N/24 © UCLES 2024 [Turn over BLANK PAGE * 0000800000015 * , , Ĭ×Ċ®Ġ´íÈõÏĪÅĊßùµĂ× ĬéºüØĥ÷ĨÖúóÑ÷ąČñėĂ ĥµąÕµĕąõµĕÅąąĕåÕÕÕ DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN
Question paper, page 16
16 9618/21/O/N/24 © UCLES 2024 8 An exam paper has a maximum of 75 marks. One of five pass grades (A to E) is assigned, depending on the mark obtained. The lowest mark for a given grade is known as the grade boundary. For example, if the grade boundary for an A grade is 65 marks, then any candidate who achieves a mark of 65 or above will be awarded an A. A grade of U is awarded for marks below the E grade boundary. The five grade boundaries are stored in a global 1D array GradeBoundary of type integer. For example: Element Value Comment GradeBoundary[1] 65 The minimum mark for an A grade. GradeBoundary[2] 57 The minimum mark for a B grade. GradeBoundary[3] 43 The minimum mark for a C grade. GradeBoundary[4] 35 The minimum mark for a D grade. GradeBoundary[5] 27 The minimum mark for an E grade. A global 2D array Result of type integer contains candidate marks for the exam. Each row relates to one candidate. Column 1 contains the candidate mark and column 2 contains the unique candidate ID. For example, for the fourth and fifth candidates: Element Mark Element ID Result[4, 1] 56 Result[4, 2] 1074832 Result[5, 1] 54 Result[5, 2] 2573839 There are more rows in the array than candidates who sit the exam. Any unused rows will be at the end of the array. Candidate papers that are given a mark within two marks of any grade boundary must be checked. For example, given the values in the example grade boundaries above, any paper that was awarded between 41 and 45 marks (inclusive) would need to be checked. A program is being written to identify papers that need to be checked. The programmer has defined the first program module as follows: Module Description CheckMark() • called with a parameter of type integer representing a candidate mark • returns TRUE if the mark is within 2 of any of the five grade boundaries, otherwise returns FALSE * 0000800000016 * , , ĬÕĊ®Ġ´íÈõÏĪÅĊÝûµĄ× ĬéºùØğąġáøüÚÕéêġğĂ ĥąÕÕõĕąÕÕµµąÅĕąÕÅÕ DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN
Question paper, page 17
17 9618/21/O/N/24 © UCLES 2024 [Turn over (a) Write pseudocode for module CheckMark(). … … … … … … … … … … … … … … … … [6] * 0000800000017 * , , Ĭ×Ċ®Ġ´íÈõÏĪÅĊÝùµĄ× Ĭé¹úÐĩĉđØĂąďāÑîġďĂ ĥąåĕµõĥµÅÅĥąÅõĥĕÕÕ DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN
Question paper, page 18
18 9618/21/O/N/24 © UCLES 2024 (b) A second module is defined: Module Description CheckAll() • called with a parameter of type integer representing the number of candidate marks in the Result array • uses CheckMark() to check each candidate mark • for each paper that needs to be checked, write the corresponding candidate ID on a separate line in a new file named GRList.txt • outputs a message with a count of how many papers need to be checked Write pseudocode for module CheckAll(). CheckMark() must be used to check each individual mark. … … … … … … … … … … … … … … … … … … … * 0000800000018 * , , ĬÕĊ®Ġ´íÈõÏĪÅĊàû·Ă× Ĭé»ùÍĝý÷ßïóô¹ë¾ÙėĂ ĥÕµĕõĕåÕõąµÅŵąÕõÕ DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN
Question paper, page 19
19 9618/21/O/N/24 © UCLES 2024 … … … … … … … … [8] (c) The requirement changes. Instead of a new file, the module described in part (b) needs to add the corresponding candidate ID for each paper that needs to be checked to an existing file. Explain the change that will need to be made to CheckAll(). … … [1] * 0000800000019 * , , Ĭ×Ċ®Ġ´íÈõÏĪÅĊàù·Ă× Ĭé¼úÕīāćÚĉþµĝÓĚÙħĂ ĥÕÅÕµõŵĥõĥÅÅÕĥĕĥÕ DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN
Question paper, page 20
20 9618/21/O/N/24 © UCLES 2024 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 Cambridge Assessment. Cambridge Assessment is the brand name of the University of Cambridge Local Examinations Syndicate (UCLES), which is a department of the University of Cambridge. BLANK PAGE * 0000800000020 * , , ĬÕĊ®Ġ´íÈõÏĪÅĊÞû·Ą× Ĭé¼ûÕġóĂÝćą®¿ï¼ÉďĂ ĥĥĕÕõõÅĕąÕĕÅąÕÅĕõÕ DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN
Mark scheme, page 1
This document consists of 13 printed pages. © Cambridge University Press & Assessment 2024 [Turn over Cambridge International AS & A Level COMPUTER SCIENCE 9618/21 Paper 2 Fundamental Problem-solving and Programming Skills October/November 2024 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 2024 series for most Cambridge IGCSE, Cambridge International A and AS Level components, and some Cambridge O Level components.
Mark scheme, page 2
9618/21 Cambridge International AS & A Level – Mark Scheme PUBLISHED October/November 2024 © Cambridge University Press & Assessment 2024 Page 2 of 13 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 descriptions 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). 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 3
9618/21 Cambridge International AS & A Level – Mark Scheme PUBLISHED October/November 2024 © Cambridge University Press & Assessment 2024 Page 3 of 13 Mark scheme abbreviations / separates alternative words / phrases within a marking point // separates alternative answers within a marking point underline actual word given must be used by candidate (grammatical variants accepted) max indicates the maximum number of marks that can be awarded ( ) the word / phrase in brackets is not required, but sets the context Note: No marks are awarded for using brand names of software packages or hardware.
Mark scheme, page 4
9618/21 Cambridge International AS & A Level – Mark Scheme PUBLISHED October/November 2024 © Cambridge University Press & Assessment 2024 Page 4 of 13 Question Answer Marks 1(a) One mark per point: Error: The calculation of TaxPayable is incorrect Correction: TaxPayable (ItemCost * TaxRate) / 100 2 1(b)(i) Use constants (to represent the tax rate values) 1 1(b)(ii) One mark per bullet point (or equivalent to max 3): 1 Tax rates are entered once only 2 Avoids / Minimise (input) error(s) / changing the Tax rates accidentally // avoids different values for tax rates at different points in the program 3 When required, the constant value (representing a tax rate) is changed (once) // Easier to maintain / update the program (when the tax rates change) 4 Makes the program / code easier to understand 3 1(c) One mark per row: Variable name Data type HighRate Boolean TaxPayable Real 2 1(d) OTHERWISE 1
Mark scheme, page 5
9618/21 Cambridge International AS & A Level – Mark Scheme PUBLISHED October/November 2024 © Cambridge University Press & Assessment 2024 Page 5 of 13 Question Answer Marks 2 Example solution: PROCEDURE Tick() SS SS + 1 IF SS = 60 THEN SS 0 MM MM + 1 IF MM = 60 THEN MM 0 HH HH + 1 IF HH = 24 THEN HH 0 CALL NewDay() ENDIF ENDIF CALL CheckAlarm() ENDIF ENDPROCEDURE Mark as follows: 1 Increment SS anywhere in the code 2 Call CheckAlarm() when SS is set to zero 3 Test if SS = 60 anywhere in the code … if so: 4 set SS to 0 5 increment MM 6 When MM is set to 60 set MM to 0 and increment HH 7 When HH is set to 24 set HH to 0 and call NewDay() Max 6 marks 6 Question Answer Marks 3(a) One mark per emboldened part: 1 Open the file (Result.txt) in read mode 2 Loop until EOF(Result.txt) // EOF // end of file 3 Read a / the / next line (from the file) and store in ThisLine 4 Assign LineY to LineX 5 Assign LineZ to LineY 6 Assign ThisLine to LineZ 7 After the loop, close the file (Result.txt) 8 Output LineX, LineY, LineZ 4
Mark scheme, page 6
9618/21 Cambridge International AS & A Level – Mark Scheme PUBLISHED October/November 2024 © Cambridge University Press & Assessment 2024 Page 6 of 13 Question Answer Marks 3(b) Example answer: So that the last three lines of the file are output in the correct order A mark for mentioning one of: • (Ensuring) the lines are output in correct order • Ordering the last three lines • Ordering the lines so they are in the same order as (they occur) in the file Max 1 marks 1 3(c) Two loop solution One mark per point: 1 Loop until given line number (-1) / <parameter> (-1) (lines have been read) 2 ... if end of file is reached then return FALSE 3 Loop for three lines // Read three lines // Repeat of 4 and 5 for three lines 4 Read a line and output it 5 ... if end of file is reached then return FALSE 6 After outputting the (required) lines return TRUE 7 Ordering of lines no longer needed Max 4 marks Alternative solution One loop solution mark scheme that reads to given line number + 2 One mark per point 1 Loop until given line number + 2 / <parameter> + 2 (lines have been read) 2 OR end of file is reached 3 Return FALSE if EOF reached 4 Read a line from the file in the loop 5 Continue to order the last three lines read in the loop // Steps 4 to 6 stay the same 6 (If FALSE has not been returned) output the required three lines (in the correct order) 7 … and Return TRUE Max 4 marks 4
Mark scheme, page 7
9618/21 Cambridge International AS & A Level – Mark Scheme PUBLISHED October/November 2024 © Cambridge University Press & Assessment 2024 Page 7 of 13 Question Answer Marks 4(a) One mark per point: Type: Run-time error Cause: A divide by zero operation is attempted // Attempt to convert a non- numeric string to a number 2 4(b) Answers include: Reason: • This part of the algorithm performs a specific task // if the check or calculation is changed it is changed only once • A (similar) subroutine is already available // Library routine is already available • The program is simplified / easier to understand / easier to design / code / test / debug / maintain Max 1 marks for 'Reason' Avoided: • Unnecessary code duplication • Errors caused by differences where several copies of the check and calculation exist Max 1 marks for 'Avoided' 2
Mark scheme, page 8
9618/21 Cambridge International AS & A Level – Mark Scheme PUBLISHED October/November 2024 © Cambridge University Press & Assessment 2024 Page 8 of 13 Question Answer Marks 4(c) Example solution: FUNCTION Evaluate(NumStr1, NumStr2 : STRING) RETURNS Result DECLARE RetVal : Result DECLARE Num1, Num2 : REAL RetVal.Done FALSE IF IS_NUM(NumStr1) = TRUE AND IS_NUM(NumStr2) = TRUE THEN Num1 STR_TO_NUM(NumStr1) Num2 STR_TO_NUM(NumStr2) IF Num2 <> 0 THEN RetVal.Value (Num1 / Num2) RetVal.Done TRUE ENDIF ENDIF RETURN RetVal ENDFUNCTION Note that order of parameters is not specified so divisor could be either parameter. Mark as follows: 1 Function heading, parameters, ending 2 ... Correct return type of Result 3 Local declaration of type Result 4 Attempt at using IS_NUM() to check both parameters/strings 5 Attempt at using of STR_TO_NUM() to convert both parameters/strings 6 Check if the divisor, is non-zero ... 7 … and if so correct calculation and assignment to Value field 8 Return variable of type Result having assigned both fields Max 6 marks 6
Mark scheme, page 9
9618/21 Cambridge International AS & A Level – Mark Scheme PUBLISHED October/November 2024 © Cambridge University Press & Assessment 2024 Page 9 of 13 Question Answer Marks 5(a) Activity Name of life cycle stage The walkthrough method is used. Testing An algorithm is implemented in a programming language. Coding The client is interviewed about problems with the current system. Analysis The program is modified to run on new hardware. Maintenance Records and file structures are defined. Design One mark per row 5 5(b)(i) One mark per row Type of test data Test data value Expected result Abnormal 12 (< 23) FALSE Abnormal / Boundary / Extreme 23 FALSE Boundary / Extreme 24 TRUE Boundary 25 TRUE Boundary 36 TRUE Boundary /Extreme 37 TRUE Abnormal / Boundary / Extreme 38 FALSE Abnormal 99 (> 38) FALSE Max 4 marks 4 5(b)(ii) Integration (testing) 1 Question Answer Marks 6(a) One mark per point: 1 Fewer lines of code are needed 2 The program is simpler/ less complex // Program is easier to design / code / maintain / modify / test / debug 3 Direct access to days in a month / data (using month number as index) // Can use index / month to (directly) access days in month / data Max 2 marks 2
Mark scheme, page 10
9618/21 Cambridge International AS & A Level – Mark Scheme PUBLISHED October/November 2024 © Cambridge University Press & Assessment 2024 Page 10 of 13 Question Answer Marks 6(b) Example Solution FUNCTION GetDate(ProductionDate : DATE, ShelfLife : INTEGER) RETURNS DATE DECLARE NewDate : DATE DECLARE DD, MM, YY, LastDay : INTEGER DD DAY(ProductionDate) MM MONTH(ProductionDate) YY YEAR(ProductionDate) DD DD + ShelfLife LastDay DaysInMonth[MM] IF DD > LastDay THEN MM MM + 1 DD DD – LastDay IF MM = 13 THEN MM 1 YY YY + 1 ENDIF ENDIF NewDate SETDATE(DD, MM, YY) RETURN NewDate ENDFUNCTION Mark as follows: 1 Declare three variables of TYPE INTEGER to store DD, MM and YY 2 Correct use of date functions from Insert to extract three integer values representing DD, MM and YY and use/assign to a variable 3 Add parameter ShelfLife to DD and use / assign result to a variable 4 Extract LastDay from DaysInMonth using MM as Index 5 Test for new DD after end of month / DaysInMonth[MM] … and if DD > DaysInMonth[MM]: 6 MM is incremented by 1 and DD is set to DD – DaysInMonth[MM] 7 If MM = 13 / MM > 12 then increment YY and set MM to 1 8 Use of SETDATE to assign value to NewDate, NewDate must have been delared as a type DATE 9 Return date Max 7 marks 7
Mark scheme, page 11
9618/21 Cambridge International AS & A Level – Mark Scheme PUBLISHED October/November 2024 © Cambridge University Press & Assessment 2024 Page 11 of 13 Question Answer Marks 7(a) One mark per point: 1 All module identified in correct hierarchy 2 Parameters to both Sync and Activate and return values 3 Parameters to both Reset and Enable 4 Parameters to Initialise 5 Decision diamond 5 7(b) Explanation: Means that Sync repeatedly calls Reset and (then) Enable One mark for each point: MP1: reference to iteration MP2: naming all three modules correctly including correct sequence of calls 2
Mark scheme, page 12
9618/21 Cambridge International AS & A Level – Mark Scheme PUBLISHED October/November 2024 © Cambridge University Press & Assessment 2024 Page 12 of 13 Question Answer Marks 8(a) Loop example solution FUNCTION CheckMark(Mark : INTEGER) RETURNS BOOLEAN DECLARE Index, Lower, Upper : INTEGER FOR Index 1 TO 5 Lower GradeBoundary[Index] - 2 Upper GradeBoundary[Index] + 2 IF Mark >= Lower AND Mark <= Upper THEN RETURN TRUE ENDIF NEXT Index RETURN FALSE ENDFUNCTION Mark as follows: 1 Loop through all elements in GradeBoundary array 2 Attempt to calculate range, both Lower and Upper, in a loop 3 Completely correct range calculation in a loop 4 Test if given mark / parameter, is within range in a loop 5 Set variable / immediate RETURN if recheck required in a loop 6 Return Boolean in both cases following a reasonable attempt Selection example solution FUNCTION CheckMark(Mark : INTEGER) RETURNS BOOLEAN CASE OF Mark GradeBoundary[1] – 2 TO GradeBoundary[1] + 2 : RETURN TRUE GradeBoundary[2] – 2 TO GradeBoundary[2] + 2 : RETURN TRUE GradeBoundary[3] – 2 TO GradeBoundary[3] + 2 : RETURN TRUE GradeBoundary[4] – 2 TO GradeBoundary[4] + 2 : RETURN TRUE GradeBoundary[5] – 2 TO GradeBoundary[5] + 2 : RETURN TRUE OTHERWISE : RETURN FALSE ENDCASE ENDFUNCTION Mark as follows: 1 Correct syntax used for selection structure(s) 2 Correct checks for two ranges 3 Correct checks for three ranges 4 Correct checks for four ranges 5 Correct checks for all five ranges 6 Return Boolean in both cases following a reasonable attempt 6
Mark scheme, page 13
9618/21 Cambridge International AS & A Level – Mark Scheme PUBLISHED October/November 2024 © Cambridge University Press & Assessment 2024 Page 13 of 13 Question Answer Marks 8(b) Example Solution: PROCEDURE CheckAll(CNum : INTEGER) DECLARE Index, Count, ThisMark: INTEGER Count 0 OPENFILE "GRList.txt" FOR WRITE FOR Index 1 to CNum ThisMark Result[Index, 1] // 2D array: mark + ID IF CheckMark(ThisMark) = TRUE THEN WRITE "GRList.txt", NUM_TO_STR(Result[Index, 2]) Count Count + 1 ENDIF NEXT Index CLOSEFILE "GRList.txt" OUTPUT "There are ", Count, " papers to check" ENDPROCEDURE Mark as follows: 1 Procedure heading, parameter and ending. 2 Open file in write mode and subsequently close 3 Loop through all CNum candidates 4 Extract candidate mark from Result array in a loop 5 Use of CheckMark() with candidate mark as parameter in a loop 6 Test return value and if TRUE then increment Count in a loop 7 ... write ID to file ... 8 ... after conversion to a string in a loop 9 Final output of message giving number of papers to check not in a loop Max 8 marks 8 8(c) The file will need to be opened in APPEND mode 1
What you needed in this session
Cambridge’s own grade thresholds for 2024 Oct/Nov, Paper 2 · Variant 1. A higher threshold means an easier paper — the bar moves with how the cohort did.