Cambridge IGCSE Computer Science (9-1) 0984 — 2024 May/June Paper 2 · Variant 2
0984/22/M/J/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 paper16 pages
















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
















Paper as text
Question paper, page 1
This document has 16 pages. Any blank pages are indicated. [Turn over Cambridge IGCSE™(9–1) COMPUTER SCIENCE 0984/22 Paper 2 Algorithms, Programming and Logic May/June 2024 1 hour 45 minutes You must answer on the question paper. No additional materials are needed. INSTRUCTIONS ● Answer all questions. ● Use a black or dark blue pen. You may use an HB pencil for any diagrams or graphs. ● 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. ● 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. * 1 1 5 0 9 7 0 0 8 9 * DC (PQ) 341260/1 © UCLES 2024
Question paper, page 2
2 0984/22/M/J/24 © UCLES 2024 1 Tick (✓) one box to identify a method used to design and construct a solution to a computing problem. A analysis B coding C flowchart D testing [1] 2 Four logic functions and five standard symbols for logic gates are shown. Draw one line to link each logic function to its standard symbol. Not all standard symbols will be used. AND Logic function Standard symbol XOR NAND OR [4] 3 Identify three different tasks in the analysis stage of the program development life cycle. 1 … … 2 … … 3 … … [3]
Question paper, page 3
3 0984/22/M/J/24 © UCLES 2024 [Turn over 4 A program needs to make sure the characters input for a product code meet these rules: • The product code is six characters in length. • The first two characters must be “PD”. • The last four characters must be a number in the range 1000 to 9999 inclusive. (a) Identify three validation checks and state how each check would make sure the product code met one of these rules. Check 1 … … … Check 2 … … … Check 3 … … … [6] (b) The program design will include a pseudocode algorithm. Assume that the product code is stored in the variable Product (i) Write the pseudocode to make sure that the product code is six characters in length. … … … … … [2] (ii) Write the pseudocode to make sure that the first two characters of the product code are “PD”. … … … … … [2]
Question paper, page 4
4 0984/22/M/J/24 © UCLES 2024 5 A high-level programming language makes use of arithmetic, Boolean and logical operators. State how each type of operator is used. Give an example statement, in pseudocode, for each one. Arithmetic … … Example … … Boolean … … Example … … Logical … … Example … … [6]
Question paper, page 5
5 0984/22/M/J/24 © UCLES 2024 [Turn over 6 Totalling and counting are standard methods of solution. Numbers are input. The number 9999.9 is the last number to be input and is ignored. (a) Write an algorithm in pseudocode to total the numbers input and to output the total. You do not need to validate the input. … … … … … … … … … [4] (b) Write an algorithm in pseudocode to count and output the number of input values that are greater than 100. You do not need to validate the input. … … … … … … … … … … [4]
Question paper, page 6
6 0984/22/M/J/24 © UCLES 2024 7 An algorithm has been written in pseudocode to find and display the maximum and minimum values in an array of 1000 positive numbers. The array List[] starts at index 1 01 Max List[1] 02 Min List[1] 03 FOR Counter 2 TO 1000 04 IF List[Counter] < Max 05 THEN 06 Max List[Counter] 07 ENDIF 08 IF List[Count] ˂ Min 09 THEN 10 Min List[Counter] 11 ENDWHILE 12 NEXT Counter 13 OUTPUT "Maximum value is ", Max 14 OUTPUT "Minimum value is ", Min (a) Give a line number for each of these types of statement: Assignment statement … Selection statement … Iteration statement … [3] (b) Identify the line numbers of the three errors in the pseudocode and suggest a correction for each error. Error 1 line number … Correction … … Error 2 line number … Correction … … Error 3 line number … Correction … … [3]
Question paper, page 7
7 0984/22/M/J/24 © UCLES 2024 [Turn over 8 A logic circuit is to be built to control the opening of a safe used to store money. There are two keys, A and B, and a time switch C. The safe can only open if both keys are used and the time switch is off. key A not used 0 used 1 key B not used 0 used 1 time switch C switch off 0 switch on 1 safe X safe cannot open 0 safe can open 1 (a) Write the logic expression for this problem. … [3] (b) Complete the truth table for this problem. A B C Working space X 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 [4]
Question paper, page 8
8 0984/22/M/J/24 © UCLES 2024 9 This flowchart represents an algorithm. A FALSE B 1 IS List[B] > List[B + 1]? T List[B] START No STOP List[B] List[B + 1] List[B + 1] T A TRUE B B + 1 IS B = 5? IS A = TRUE? Yes Yes Yes No No (a) The array List[1:5] used in the flowchart contains this data: List[1] List[2] List[3] List[4] List[5] 15 17 20 5 9
Question paper, page 9
9 0984/22/M/J/24 © UCLES 2024 [Turn over Complete the trace table using the data given in the array. A B List[1] List[2] List[3] List[4] List[5] T 15 17 20 5 9 [5] (b) Describe what the algorithm represented by the flowchart is doing. … … … … [2]
Question paper, page 10
10 0984/22/M/J/24 © UCLES 2024 10 A television subscription service has a new database table named Contract to store details of their subscribers’ contracts. The table contains these fields: • ContractNumber – the contract number, for example CT567 • Months – the length of the contract in months, for example 6 • EndDate – the date the contract finishes, for example 30 November 2024 • News – the news service, yes or no • Movie – the movie service, yes or no • Sport – the sports service, yes or no • Junior – the children’s service, yes or no. (a) Identify the field that will be the most appropriate primary key for this table. … [1] (b) Complete the table to identify the most appropriate data type for these fields in Contract Field Data type ContractNumber Months EndDate Sport [2] (c) Explain the purpose of these structured query language (SQL) statements. Statement 1: SELECT SUM (Months) FROM Contract; Statement 2: SELECT COUNT (News) FROM Contract WHERE News; Statement 1 … … … Statement 2 … … … [3]
Question paper, page 11
11 0984/22/M/J/24 © UCLES 2024 [Turn over (d) Complete this SQL statement to find the contract numbers of the subscribers that take both the news and sports services. SELECT … FROM Contract WHERE … AND … ; [2]
Question paper, page 12
12 0984/22/M/J/24 © UCLES 2024 11 A one-player game uses the two-dimensional (2D) array Grid[] to store the location of a secret cell to be found by the player in 10 moves. Each row and column has 5 cells. Start Grid[1,1] At the start of the game: • The program places an ‘X’ in a random cell (not in Grid[1,1]) and empties all the other cells in the grid. • The player starts at the top left of the grid. • The player has 10 moves. During the game: • The player can move left, right, up or down by one cell and the move must be within the grid. • “You Win” is displayed if the player moves to the cell with ‘X’ and has played 10 moves or less. • “You Lose” is displayed if the player has made 10 moves without finding the ‘X’. Write a program that meets these requirements. You must use pseudocode or program code and add comments to explain how your code works. You do not need to declare any arrays or variables; you may assume that this has already been done. All inputs and outputs must contain suitable messages. … … … … … … … … …
Question paper, page 13
13 0984/22/M/J/24 © UCLES 2024 [Turn over … … … … … … … … … … … … … … … … … … … … … … … … … … … …
Question paper, page 14
14 0984/22/M/J/24 © UCLES 2024 … … … … … … … … … … … … … … … … … … … … … … … … … … … … [15]
Question paper, page 15
15 0984/22/M/J/24 © UCLES 2024 BLANK PAGE
Question paper, page 16
16 0984/22/M/J/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
Mark scheme, page 1
This document consists of 16 printed pages. © Cambridge University Press & Assessment 2024 [Turn over Cambridge IGCSE™ (9–1) COMPUTER SCIENCE 0984/22 Paper 2 Algorithms, Programming and Logic May/June 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 May/June 2024 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
0984/22 Cambridge IGCSE (9–1) – Mark Scheme PUBLISHED May/June 2024 © Cambridge University Press & Assessment 2024 Page 2 of 16 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.
Mark scheme, page 3
0984/22 Cambridge IGCSE (9–1) – Mark Scheme PUBLISHED May/June 2024 © Cambridge University Press & Assessment 2024 Page 3 of 16 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 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
0984/22 Cambridge IGCSE (9–1) – Mark Scheme PUBLISHED May/June 2024 © Cambridge University Press & Assessment 2024 Page 4 of 16 Question Answer Marks 1 C 1 Question Answer Marks 2 One mark for each correct line Logic function Standard symbol 4 AND XOR NAND OR
Mark scheme, page 5
0984/22 Cambridge IGCSE (9–1) – Mark Scheme PUBLISHED May/June 2024 © Cambridge University Press & Assessment 2024 Page 5 of 16 Question Answer Marks 3 One mark for each correct answer max three MP1 abstraction MP2 decomposition MP3 identification of problem MP4 identification of requirements // outline of success criteria 3 Question Answer Marks 4(a) One mark per mark point MP1 length check … MP2 … to ensure the product code entered is 6 characters in length MP3 format check … MP4 … to ensure the first two characters of the product code entered are “PD” MP5 range check … MP6 … to ensure that the value of the last four figures of the product code entered is between 1000 and 9999 6 4(b)(i) One mark for correct use of LENGTH operation, one mark for appropriate test Example: REPEAT INPUT Product UNTIL LENGTH(Product) = 6 2 4(b)(ii) One mark for correct use of SUBSTRING operation, one mark for appropriate test Example: REPEAT INPUT Product UNTIL SUBSTRING(Product, 1, 2) = "PD" 2
Mark scheme, page 6
0984/22 Cambridge IGCSE (9–1) – Mark Scheme PUBLISHED May/June 2024 © Cambridge University Press & Assessment 2024 Page 6 of 16 Question Answer Marks 5 One mark for each description, one mark for each example arithmetic – used in calculations (1) A B + C (1) Boolean – used for operations with true or false values (1) IF B AND C (1) logical – used in comparisons/conditional statements/selection statements (1) IF B > C (1) 6 Question Answer Marks 6(a) One mark for: MP1 adding current value to total One mark for each point max three. MP2 input more than one number MP3 setting total to zero before loop MP4 correct use of loop including terminal condition MP5 output total after loop Example: Total 0 INPUT Value WHILE Value <> 9999.9 Total Total + Value INPUT Value ENDWHILE OUTPUT Total Value 0 Total 0 REPEAT Total Total + Value INPUT Value UNTIL Value = 9999.9 OUTPUT Total 4
Mark scheme, page 7
0984/22 Cambridge IGCSE (9–1) – Mark Scheme PUBLISHED May/June 2024 © Cambridge University Press & Assessment 2024 Page 7 of 16 Question Answer Marks 6(b) One mark for each point MP1 adding one to counter MP2 correct use of selection, if current value > 100 THEN … ENDIF One mark for each point, max two MP3 input more than one number MP4 setting counter to zero before loop MP5 correct use of loop including terminal condition MP6 output value of counter after loop Example: Counter 0 INPUT Value WHILE Value <> 9999.9 IF Value > 100 THEN Counter Counter + 1 ENDIF INPUT Value ENDWHILE OUTPUT Counter 4 Question Answer Marks 7(a) 01//02//06//10 04(07) and/or 08 03(12) 3
Mark scheme, page 8
0984/22 Cambridge IGCSE (9–1) – Mark Scheme PUBLISHED May/June 2024 © Cambridge University Press & Assessment 2024 Page 8 of 16 Question Answer Marks 7(b) One mark for each error identified and corrected Line 04 < should be > Line 08 Count should be Counter Line 11 ENDWHILE should be ENDIF 01 Max List[1] 02 Min List[1] 03 FOR Counter 2 TO 1000 04 IF List[Counter] > Max 05 THEN 06 Max List[Counter] 07 ENDIF 08 IF List[Counter] < Min 09 THEN 10 Min List[Counter] 11 ENDIF 12 NEXT Counter 13 OUTPUT "Maximum value is ", Max 14 OUTPUT "Minimum value is ", Min 3 Question Answer Marks 8(a) X = 1 mark (A AND B) // A AND B 1 mark AND NOT C 1 mark X = (A AND B) AND NOT C 3
Mark scheme, page 9
0984/22 Cambridge IGCSE (9–1) – Mark Scheme PUBLISHED May/June 2024 © Cambridge University Press & Assessment 2024 Page 9 of 16 Question Answer Marks 8(b) Four marks for 8 correct outputs Three marks for 6/7 correct outputs Two marks for 4/5 correct outputs One mark for 2/3 correct outputs A B C X 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0 0 1 0 1 0 1 1 0 1 1 1 1 0 4
Mark scheme, page 10
0984/22 Cambridge IGCSE (9–1) – Mark Scheme PUBLISHED May/June 2024 © Cambridge University Press & Assessment 2024 Page 10 of 16 Question Answer Marks 9(a) One mark for each of columns A, B and T Two marks for columns List[1] to List[5] all entries correct or One mark for columns List[1] to List[5] with one error A B List[1] List[2] List[3] List[4] List[5] T 15 17 20 5 9 FALSE 1 17 15 15 TRUE 2 20 15 15 TRUE 3 TRUE 4 9 5 5 5 FALSE 1 20 17 17 TRUE 2 3 4 5 FALSE 1 2 3 4 5 5
Mark scheme, page 11
0984/22 Cambridge IGCSE (9–1) – Mark Scheme PUBLISHED May/June 2024 © Cambridge University Press & Assessment 2024 Page 11 of 16 Question Answer Marks 9(b) One mark for each point MP1 (bubble) sort data in array MP2 in descending order 2 Question Answer Marks 10(a) ContractNumber 1 10(b) One mark for every two correct data types Field Data type ContractNumber text/alphanumeric Months integer EndDate date/time Sport Boolean 2 10(c) One mark for each point MP1 to find the total number of months for all contracts MP2 to find the number of contracts MP3 … that are subscribed to News 3 10(d) ContractNumber News AND Sport // Sport AND News Example answer: SELECT ContractNumber FROM Contract WHERE News // News = TRUE AND Sport // Sport = TRUE ; 2
Mark scheme, page 12
0984/22 Cambridge IGCSE (9–1) – Mark Scheme PUBLISHED May/June 2024 © Cambridge University Press & Assessment 2024 Page 12 of 16 Question Answer Marks 11 Data Structures required with names as given in the scenario: Arrays or lists Grid Requirements (techniques) R1 Set up game – generate random cell, clear all other cells in array, set player start position and start player moves counter (iteration, use of arrays and library routines (round and random)) R2 Input and check move – is it valid? (input, output, iteration and selection) R3 Decide outcome – has move found the X? If so, give appropriate output. If not increment counter and continue. If 10 moves exceeded, give appropriate output (use of arrays, iteration, selection and output). Example 15-mark answer in pseudocode // Set up game FOR Row 1 TO 5 FOR Column 1 TO 5 Grid[Row, Column] ''// set grid cells to be empty NEXT Column NEXT Row 15
Mark scheme, page 13
0984/22 Cambridge IGCSE (9–1) – Mark Scheme PUBLISHED May/June 2024 © Cambridge University Press & Assessment 2024 Page 13 of 16 Question Answer Marks 11 REPEAT // not in cell 1,1 XRow ROUND ((RANDOM() * 4) + 1, 0) // Random row position between 1 and 5 in GRID XColumn ROUND ((RANDOM() * 4) + 1, 0) // Random column position between 1 and 5 in GRID UNTIL XRow <> 1 and XColumn <> 1 // not in cell 1,1 Grid [XRow, XColumn] 'X' MaxMove 10 NumberMoves 0 PlayerRow 1 PlayerColumn 1 Win FALSE // during game WHILE NumberMoves < MaxMove AND NOT Win MoveError FALSE OUTPUT "Please enter your move, L – Left, R – Right, U – Up or D - Down" INPUT UPPER(PlayerMove) REPEAT CASE OF PlayerMove 'L' : TempColumn PlayerColumn – 1 'R' : TempColumn PlayerColumn + 1 'U' : TempRow PlayerRow – 1 'D' : TempRow PlayerRow + 1 OTHERWISE MoveError TRUE ENDCASE // check for out-of-range moves IF TempColumn < 1 or TempColumn > 5 THEN MoveError TRUE ELSE PlayerColumn TempColumn ENDIF
Mark scheme, page 14
0984/22 Cambridge IGCSE (9–1) – Mark Scheme PUBLISHED May/June 2024 © Cambridge University Press & Assessment 2024 Page 14 of 16 Question Answer Marks 11 IF TempRow < 1 or TempRow > 5 THEN MoveError TRUE ELSE PlayerRow TempRow ENDIF // check win if X Found IF Grid [PlayerRow, PlayerColumn] = 'X' THEN OUTPUT "You Win" Win TRUE ELSE IF NOT MoveError THEN NumberMoves NumberMoves + 1 ENDIF ENDIF UNTIL NOT MoveError ENDWHILE IF NOT Win THEN OUTPUT "You Lose" ENDIF
Mark scheme, page 15
0984/22 Cambridge IGCSE (9–1) – Mark Scheme PUBLISHED May/June 2024 © Cambridge University Press & Assessment 2024 Page 15 of 16 Marking Instructions in italics AO2: Apply knowledge and understanding of the principles and concepts of computer science to a given context, including the analysis and design of computational or programming problems 0 1–3 4–6 7–9 No creditable response. At least one programming technique has been used. Any use of selection, iteration, counting, totalling, input and output. Some programming techniques used are appropriate to the problem. More than one technique seen applied to the scenario, check the list of techniques needed. The range of programming techniques used is appropriate to the problem. All criteria stated for the scenario have been covered by the use of appropriate programming techniques, check the list of techniques needed. Some data has been stored but not appropriately. Any use of variables or arrays or other language dependent data structures e.g. Python lists. Some of the data structures chosen are appropriate and store some of the data required. More than one data structure used to store data required by the scenario. The data structures chosen are appropriate and store all the data required. The data structures used store all the data required by the scenario.
Mark scheme, page 16
0984/22 Cambridge IGCSE (9–1) – Mark Scheme PUBLISHED May/June 2024 © Cambridge University Press & Assessment 2024 Page 16 of 16 Marking Instructions in italics AO3: Provide solutions to problems by: evaluating computer systems making reasoned judgements presenting conclusions 0 1–2 3–4 5–6 No creditable response Program seen without relevant comments. Program seen with some relevant comment(s). The program has been fully commented Some identifier names used are appropriate. Some of the data structures used have meaningful names. The majority of identifiers used are appropriately named. Most of the data structures used have meaningful names. Suitable identifiers with names meaningful to their purpose have been used throughout. All of the data structures used have meaningful names. The solution is illogical. The solution contains parts that may be illogical The program is in a logical order. The solution is inaccurate in many places. Solution contains few lines of code with errors that attempt to perform a task given in the scenario The solution contains parts that are inaccurate. Solution contains lines of code with some errors that logically perform tasks given in the scenario. Ignore minor syntax errors. The solution is accurate. Solution logically performs all the tasks given in the scenario. Ignore minor syntax errors. The solution attempts at least one of the requirements. Solution contains lines of code that attempt at least one task given in the scenario. The solution attempts to meet most of the requirements. Solution contains lines of code that attempt most tasks given in the scenario. The solution meets all the requirements given in the question. Solution performs all the tasks given in the scenario.
What you needed in this session
Cambridge’s own grade thresholds for 2024 May/June, Paper 2 · Variant 2. A higher threshold means an easier paper — the bar moves with how the cohort did.