A Level Computer Science 9618 · Paper practice

Paper 2 past paper questions

Every archived Computer Science 9618 Paper 2 question in one place. Practise them by topic, then sit a full paper under timed conditions.

Most-tested topicsProgramming 146Data Types and Structures 114Software Development 79Algorithm Design and Problem-solving 62

Paper
Sort questions

You’re practising 2021–2022 papers. The 2023–2026 papers, including 2026, need a plan.

Unlock from $6/mo
24 free questions

2022 JunePaper 2Question 1Component 21Variant 111 marks
Data Types and StructuresData Types and RecordsAlgorithmsProgramming Basics
Loading original question

1 (a) A programmer draws a program flowchart to show the sequence of steps required to solve a problem. Give the technical term for a sequence of steps that describe how to solve a problem. [1] (b) The table lists some of the variables used in a program. (i) Complete the table by writing the most appropriate data type for each variable. Variable | Use of variable | Data type Temp | Stores the average temperature | '' PetName | Stores the name of my pet | '' MyDOB | To calculate the number of days until my next birthday | '' LightOn | Stores state of light; light is only on or off | '' [4] (ii) One of the names used for a variable in the table in part 1(b)(i) is not an example of good practice. Identify the variable and give a reason why it is not good practice to use that name. Variable ... Reason ... [2] (c) Complete the table by evaluating each expression. Expression | Evaluation INT((31 / 3) + 1) | '' MID(TO_UPPER("Version"), 4, 2) | '' TRUE AND (NOT FALSE) | '' NUM_TO_STR(27 MOD 3) | '' [4]

2022 JunePaper 2Question 1Component 22Variant 211 marks
Software DevelopmentProgram Testing and MaintenanceAlgorithmsProgram Development Life cycle
Loading original question

1 (a) A programmer is testing a program using an Integrated Development Environment (IDE). The programmer wants the program to stop when it reaches a specific instruction or program statement in order to check the value assigned to a variable. Give the technical term for the position at which the program stops. [1] (b) The following table lists some activities from the program development life cycle. Complete the table by writing the life cycle stage for each activity. Activity | Life cycle stage An identifier table is produced. | '' Syntax errors can occur. | '' The developer discusses the program requirements with the customer. | '' A trace table is produced. | '' [4] (c) An identifier table includes the names of identifiers used. State two other pieces of information that the identifier table should contain. 1 ... 2 ... [2] (d) The pseudocode statements in the following table may contain errors. State the error in each case or write 'NO ERROR' if the statement contains no error. You can assume that none of the variables referenced are of an incorrect type. Statement | Error Status <- TRUE AND FALSE | '' IF LENGTH("Password") < "10" THEN | '' Code <- LCASE("Electrical") | '' Result <- IS_NUM(-27.3) | '' [4]

2022 JunePaper 2Question 1Component 23Variant 38 marks
ProgrammingConstructsProgramming Basics
Loading original question

1 (a) The following table contains pseudocode examples. Each example may include all or part of: selection, iteration (repetition), assignment. Complete the table by placing one or more ticks (✓) in each row. [5] Pseudocode example | Selection | Iteration | Assignment FOR Index ← 1 TO 3 / Safe[Index] ← GetResult() / NEXT Index | '' | '' | '' OTHERWISE : OUTPUT "ERROR 1202" | '' | '' | '' REPEAT UNTIL Index = 27 | '' | '' | '' INPUT MyName | '' | '' | '' IF Mark > 74 THEN / Grade ← 'A' / ENDIF | '' | '' | '' (b) (i) Program variables have values as follows: Variable | Value AAA | TRUE BBB | FALSE Count | 99 Complete the table by evaluating each expression. [2] Expression | Evaluation AAA AND (Count > 99) | '' AAA AND (NOT BBB) | '' (Count <= 99) AND (AAA OR BBB) | '' (BBB AND Count > 50) OR NOT AAA | '' (ii) Give an example of when a variable of type Boolean would be used. [1]

2022 NovemberPaper 2Question 1Component 21Variant 112 marks
ProgrammingProgramming BasicsArrays
Loading original question

1 (a) An algorithm includes a number of complex calculations. A programmer is writing a program to implement the algorithm and decides to use library routines to provide part of the solution. State three possible benefits of using library routines in the development of the program. 1 … 2 … 3 … [3] (b) The following pseudocode is part of a program that stores names and test marks for use in other parts of the program. DECLARE Name1, Name2, Name3 : STRING DECLARE Mark1, Mark2, Mark3 : INTEGER INPUT Name1 INPUT Mark1 INPUT Name2 INPUT Mark2 INPUT Name3 INPUT Mark3 (i) The pseudocode needs to be changed to allow for data to be stored for up to 30 students. Explain why it would be good practice to use arrays to store the data. [3] (ii) The following pseudocode statement includes array references: OUTPUT "Student ", Name[Count], " scored ", Mark[Count] State the purpose of the variable Count and give its data type. Purpose … Data type … [2] (c) The pseudocode statements in the following table may contain errors. State the error in each case or write 'NO ERROR' if the statement contains no error. Assume that any variables used are of the correct type for the given function. Statement | Error IF EMPTY ← "" THEN | '' Status ← IS_NUM(-23.4) | '' X ← STR_TO_NUM("37") + 5 | '' Y ← STR_TO_NUM("37" + "5") | '' [4]

2022 NovemberPaper 2Question 1Component 22Variant 211 marks
ProgrammingStructured ProgrammingProgramming BasicsProgram Testing and Maintenance
Loading original question

1 (a) A programmer is developing an algorithm to solve a problem. Part of the algorithm would be appropriate to implement as a subroutine (a procedure or a function). (i) State two reasons why the programmer may decide to use a subroutine. 1 … 2 … [2] (ii) A procedure header is shown in pseudocode: PROCEDURE MyProc(Count : INTEGER, Message : STRING) Give the correct term for the identifiers Count and Message and explain their use. Term … Use … [2] (b) The algorithm in part (a) is part of a program that will be sold to the public. All the software errors that were identified during in-house testing have been corrected. Identify and describe the additional test stage that may be carried out before the program is sold to the public. Test stage … Description … [4] (c) Part of an identifier table is shown: Variable | Type | Example value FlagDay | DATE | 23/04/2004 CharList | STRING | "ABCDEF" Count | INTEGER | 29 Complete the table by evaluating each expression using the example values. Expression | Evaluation MID(CharList, MONTH(FlagDay), 1) | '' INT(Count / LENGTH(CharList)) | '' (Count >= 29) AND (DAY(FlagDay) > 23) | '' [3]

2022 NovemberPaper 2Question 1Component 23Variant 312 marks
Software DevelopmentProgram Development Life cycleData Types and RecordsProgram Testing and Maintenance
Loading original question

1 A program is required for a shopping website. (a) Part of the program requires four variables. The following table describes the use of each variable. Complete the table by adding the most appropriate data type for each variable. Variable use | Data type. Store the number of days in the current month | ''. Store the first letter of the customer's first name | ''. Store an indication of whether a year is a leap year | ''. Store the average amount spent per customer visit | ''. [4] (b) The designer considers the use of a development life cycle to split the development of the website into several stages. (i) State one benefit of a development life cycle when developing the website. [1] (ii) Analysis is one stage of a development life cycle. State one document that may be produced from the analysis stage of the website project. [1] (c) The program will be developed using the Rapid Application Development (RAD) life cycle. (i) State one principle of this life cycle. [1] (ii) Give two benefits and one drawback of its use compared to the waterfall life cycle. Benefit 1 Benefit 2 Drawback [3] (d) Adaptive maintenance needs to be carried out on the website program. Give two reasons why adaptive maintenance may be required. 1 2 [2]

2022 JunePaper 2Question 2Component 21Variant 17 marks
Software DevelopmentProgram Design
Loading original question

2 Examine the following state-transition diagram. [State-transition diagram: START arrow into S1. S1 -> S3 on Button-Y. S1 -> S2 on Button-X. S2 -> S1 on Button-Z. S2 -> S4 on Button-Y | Output-A. S4 -> S2 on Button-Z | Output-B. S3 -> S4 on Button-Y. S3 -> S3 (self loop) on Button-Z | Output-C.] (a) Complete the table with reference to the diagram. | Answer The number of different inputs | '' The number of different outputs | '' The single input value that could result in S4 | '' [3] (b) The initial state is S1. Complete the table to show the inputs, outputs and next states. Input | Output | Next state Button-Y | '' | '' '' | none | '' Button-Z | '' | S2 '' | none | '' [4]

2022 JunePaper 2Question 2Component 22Variant 24 marks
Algorithm Design and Problem-solvingAlgorithms
Loading original question

2 An algorithm is described as follows: 1. Input an integer value. 2. Jump to step 6 if the value is less than zero. 3. Call the function IsPrime() using the integer value as a parameter. 4. Keep a count of the number of times function IsPrime() returns TRUE. 5. Repeat from step 1. 6. Output the value of the count with a suitable message. Draw a program flowchart to represent the algorithm. [A box is provided containing a START terminator at the top and an END terminator at the bottom.] [4]

2022 JunePaper 2Question 2Component 23Variant 34 marks
Software DevelopmentProgram Testing and Maintenance
Loading original question

2 A program has been written to implement a website browser and maintenance is now required. One type of maintenance is called perfective. Name two other types of maintenance that the program may require and give a reason for each. Type 1 … Reason … Type 2 … Reason … [4]

2022 NovemberPaper 2Question 2Component 21Variant 15 marks
Algorithm Design and Problem-solvingComputational Thinking Skills
Loading original question

2 A system is being developed to help manage a car hire business. A customer may hire a car for a number of days. An abstract model needs to be produced. (a) Explain the process of abstraction and state four items of data that should be stored each time a car is hired. Explanation … Item 1 … Item 2 … Item 3 … Item 4 … [3] (b) Identify two operations that would be required to process the car hire data. Operation 1 … Operation 2 … [2]

2022 NovemberPaper 2Question 2Component 22Variant 211 marks
Data Types and StructuresFilesAlgorithmsProgram Design
Loading original question

2 (a) An algorithm will process data from a test taken by a group of students. The algorithm will prompt and input the name and test mark for each of the 35 students. The algorithm will add the names of all the students with a test mark of less than 20 to an existing text file Support_List.txt, which already contains data from other group tests. (i) Describe the steps that the algorithm should perform. Do not include pseudocode statements in your answer. [5] (ii) Explain why it may be better to store the names of the students in a file rather than in an array. [1] (iii) Explain why WRITE mode cannot be used in the answer to part 2(a)(i). [1] (b) Examine the following state-transition diagram. [State-transition diagram: START arrow to S1. S1 to S2 on Input-A | Output-X. S2 loops to itself on Input-A. S2 to S3 on Input-B | Output-W. S3 loops to itself on Input-B. S3 to S4 on Input-A | Output-W. S4 to S1 on Input-A. S1 to S4 on Input-B.] Complete the table to show the inputs, outputs and next states. Input | Output | Next state (shaded) | (shaded) | S1 Input-A | '' | '' '' | '' | S2 '' | Output-W | '' '' | Output-W | '' [4]

2022 NovemberPaper 2Question 2Component 23Variant 33 marks
Algorithm Design and Problem-solvingComputational Thinking Skills
Loading original question

2 A program is being designed for a smartphone to allow users to send money to the charity of their choice. Decomposition will be used to break the problem down into sub-problems. Identify three program modules that could be used in the design and describe their use. Module 1 Use Module 2 Use Module 3 Use [3]

2022 JunePaper 2Question 3Component 21Variant 14 marks
Algorithm Design and Problem-solvingComputational Thinking Skills
Loading original question

3 The manager of a cinema wants a program to allow users to book seats. The cinema has several screens. Each screen shows a different film. (a) Decomposition will be used to break the problem down into sub-problems. Describe three program modules that could be used in the design. Module 1 ... Module 2 ... Module 3 ... [3] (b) Two types of program modules may be used in the design of the program. Identify the type of program module that should be used to return a value. [1]

2022 JunePaper 2Question 3Component 22Variant 29 marks
Software DevelopmentProgram DesignComputational Thinking Skills
Loading original question

3 (a) The module headers for five modules in a program are defined in pseudocode as follows: Pseudocode module header FUNCTION Mod_V(S2 : INTEGER) RETURNS BOOLEAN PROCEDURE Mod_W(P4 : INTEGER) PROCEDURE Mod_X(T4 : INTEGER, BYREF P3 : REAL) PROCEDURE Mod_Y(W3 : REAL, Z8 : INTEGER) FUNCTION Mod_Z(F3 : REAL) RETURNS INTEGER An additional module Head() repeatedly calls three of the modules in sequence. A structure chart has been partially completed. (i) Complete the structure chart to include the information given about the six modules. Do not label the parameters and do not write the module names. [Structure chart: top box A with lines to boxes B, C and D. Under the A-B line a data-flow arrow with open circle points down toward B. Under A-C a down arrow with open circle and an up arrow with open circle (data passed both ways). Under A-D an up arrow with filled circle (flag) towards A. Box D has lines to boxes E and F. Under D-E an up arrow with open circle (towards D). Under D-F a down arrow with open circle and another down arrow with open circle.] [3] (ii) Complete the table using the information in part 3(a) by writing each module name to replace the labels A to F. Label | Module name A | '' B | '' C | '' D | '' E | '' F | '' [3] (b) The structure chart represents part of a complex problem. The process of decomposition is used to break down the complex problem into sub-problems. Describe three benefits of this approach. 1 ... 2 ... 3 ... [3]

2022 JunePaper 2Question 3Component 23Variant 37 marks
Software DevelopmentProgram Design
Loading original question

3 Four program modules are defined as follows: Pseudocode module header PROCEDURE Sub1_A(XT : INTEGER, PB : STRING) FUNCTION Sub1_B(RA : INTEGER) RETURNS BOOLEAN PROCEDURE Sub1_C(SB : INTEGER, BYREF SA : STRING) PROCEDURE Section_1() (a) A structure chart will be produced as part of the development process. Describe the purpose of a structure chart. [2] (b) Module Section_1() calls one of the other three modules. The module called will be selected when the program runs. Draw the structure chart. [5] [A large empty box for the drawing.]

2022 NovemberPaper 2Question 3Component 21Variant 15 marks
Algorithm Design and Problem-solvingAlgorithmsArrays
Loading original question

3 A 1D array Data of type integer contains 200 elements. Each element has a unique value. An algorithm is required to search for the largest value and output it. Describe the steps that the algorithm should perform. Do not include pseudocode statements in your answer. [5]

2022 NovemberPaper 2Question 3Component 22Variant 213 marks
Data Types and StructuresIntroduction to Abstract Data Types (ADT)
Loading original question

3 A stack is used in a program to store string data which needs to be accessed in several modules. (a) A stack is an example of an Abstract Data Type (ADT). Identify one other example of an ADT and describe its main features. Example … Features … [3] (b) Explain how the stack can be implemented using an array. [5] (c) A second stack is used in the program. The diagram below shows the initial state of this stack. Value X is at the top of the stack and was the last item added. Upper-case letters are used to represent different data values. Stack operations are performed in three groups as follows: Group 1: PUSH D, PUSH E Group 2: POP, POP, POP Group 3: PUSH A, PUSH B, POP, PUSH C Complete the diagram to show the state of the stack after each group of operations has been performed. Include the current stack pointer (SP) after each group. Memory location | Initial state | After Group 1 | After Group 2 | After Group 3 957 | '' | '' | '' | '' 956 | '' | '' | '' | '' 955 | '' | '' | '' | '' 954 | '' | '' | '' | '' 953 | X (SP points here) | '' | '' | '' 952 | Y | '' | '' | '' 951 | Z | '' | '' | '' 950 | P | '' | '' | '' [5]

2022 NovemberPaper 2Question 3Component 23Variant 35 marks
Algorithm Design and Problem-solvingAlgorithms
Loading original question

3 An algorithm is needed to process a sequence of numbers. Numbers may be positive or negative and may be integer or decimal. The algorithm will: prompt and input one number at a time until the value zero is input; sum the negative numbers; sum the positive numbers; when zero is input, output the two sum values and then end. Describe the algorithm needed. Do not include pseudocode statements in your answer. [5]

2022 JunePaper 2Question 4Component 21Variant 16 marks
Data Types and StructuresIntroduction to Abstract Data Types (ADT)
Loading original question

4 A stack is created using a high-level language. Memory locations 200 to 207 are to be used to store the stack. The following diagram represents the current state of the stack. TopOfStack points to the last value added to the stack. Memory location | Value 200 | '' 201 | '' 202 | '' 203 | 'F' <- TopOfStack 204 | 'C' 205 | 'D' 206 | 'E' 207 | 'H' (a) Complete the following table by writing the answers. The value that has been on the stack for the longest time. | '' The memory location pointed to by TopOfStack if three POP operations are performed. | '' [2] (b) The following diagram shows the current state of the stack: 200 | '' 201 | '' 202 | 'W' <- TopOfStack 203 | 'Y' 204 | 'X' 205 | 'Z' 206 | 'N' 207 | 'P' The following operations are performed: POP, POP, PUSH 'A', PUSH 'B', POP, PUSH 'C', PUSH 'D' Complete the diagram to show the state of the stack after the operations have been performed. (Blank table with Memory location 200 to 207, a Value column and a Pointer column.) [4]

2022 JunePaper 2Question 4Component 22Variant 29 marks
ProgrammingProgramming BasicsFilesStructured Programming
Loading original question

4 (a) A procedure LastLines() will: - take the name of a text file as a parameter - output the last three lines from that file, in the same order as they appear in the file. Note: Use local variables LineX, LineY and LineZ to store the three lines from the file. You may assume the file exists and contains at least three lines. Write pseudocode for the procedure LastLines(). [6] (b) The algorithm in part (a) is to be amended. The calling program will pass the number of lines to be output as well as the name of the text file. The number of lines could be any value from 1 to 30. It can be assumed that the file contains at least the number of lines passed. Outline three changes that would be needed. 1 ... 2 ... 3 ... [3]

Full Paper 2 past papers with mark schemes

Paper 2: quick facts

Which topics come up most in A Level Computer Science 9618 Paper 2?

The most-tagged topics in A Level Computer Science 9618 Paper 2 are Programming (146), Data Types and Structures (114) and Software Development (79), out of 238 past-paper questions from 2021-2026. These are archive counts, not a prediction, and a question can carry more than one topic.

Are the A Level Computer Science 9618 Paper 2 questions free?

74 of the 238 A Level Computer Science 9618 Paper 2 questions are free to practise. The other 164 need a plan for A Level Computer Science 9618, from $6 a month.

Do the A Level Computer Science 9618 Paper 2 questions have answers?

Yes. Each A Level Computer Science 9618 Paper 2 question shows the official mark scheme answer.