A Level Computer Science 9618 Paper 22, May/June 2025

Question paper and mark scheme75 marks7 questions

Solve it on ExamPal

Practise

Untimed. Write on the paper and check as you go.

Start

Exam

Timed, with a clock you set, like sitting the real paper.

Start

Opens full screen.

Opening the question paper

Read as textThe questions and the mark scheme as plain text. Easier to read on a phone.

Question paper

9618/22 · May/June 2025

Download PDF
1

A program is being developed to control the production line in a factory.

a(i)

A number of different program life cycles are available for the development of a program. Explain the need for different program development life cycles.

[1]
a(ii)

Coding is a stage in a program development life cycle. State one consideration that would influence the choice of programming language.

[1]
b(i)

The program has been in use for a number of months and adaptive maintenance is required. Give three reasons why adaptive maintenance may be required. 1 ........................................................................................................................................ 2 ........................................................................................................................................ 3 ........................................................................................................................................

[3]
b(ii)

As well as adaptive maintenance, other types of program maintenance may be needed. Identify one other type of program maintenance.

[1]
c

Pseudocode has been used to design modules for the program to control the production line. The table shows four valid pseudocode expressions. Complete the table by giving the data type of the evaluated expression.

ExpressionData type
RIGHT(MachineCode, 4)
Speed * 2.5
NOT Status
IS_NUM(Check)
[4]
d(i)

A global array Product is used as part of the pseudocode design being developed to control the production line. Product is used to store the number of rejected items each day. The following pseudocode statement is used to assign a value to an element of the array: Product[x, y] ← 23 The lower and upper bound values are shown in the table:

VariableLower boundUpper bound
x099
y09

State the number of dimensions of Product

[1]
d(ii)

State the total number of elements in array Product

[1]
d(iii)

Give the pseudocode declaration for the array Product

[2]
2

A program to calculate the pay of employees working for a company is being designed.

a

Stepwise refinement has been used in the design of the program. Describe stepwise refinement.

[2]
b(i)

One of the program modules used to calculate employees' weekly bonus pay has been completed. The amount of bonus pay they receive is based on the number of hours worked and the value of sales made as shown in the table. Bonus pay and value of sales are both in dollars.

Hours workedValue of salesBonus pay
between 1 and 40 inclusive2000 or less0
between 1 and 40 inclusiveabove 200050
above 402000 or less10
above 40above 2000100

The module is tested using white-box testing. State two tests, using valid data, that can be used to test different paths through the program. Test one: Hours worked ................................................. Value of sales ................................................. Bonus pay ...................................................... Test two: Hours worked ................................................. Value of sales ................................................. Bonus pay ......................................................

[2]
b(ii)

The program to calculate pay uses a number of modules which are each called from different places in the program. The program is to be tested using stub testing before all the program modules have been completed. Describe stub testing.

[2]
b(iii)

The program has been completed and compiles successfully. The program is tested using black-box testing. Identify and describe one type of error that black-box testing could detect. Type of error ...................................................................................................................... Description

[2]
3

An algorithm is designed to generate and output two unique random integers. Each integer value is between –10 and 10 inclusive. If both integers output are negative, a third random integer between 30 and 35 inclusive will be generated and output. Write pseudocode for this algorithm.

[8]
4

An algorithm will: • input 100 integer values, one value at a time • store the first value input into the first location of the array Number • store the next input value in the next unused location of the array Number • output the contents of Number array in the opposite sequence to that in which the values were input. Complete the program flowchart to represent the algorithm. Variable declarations are not required.

[6]
Figure 1 of 2 for question 4
Figure 2 of 2 for question 4
5

An automated digital camera system is used to take a sequence of pictures of animals in a garden. During the design of the system, a state-transition diagram is produced. The table details the states in the automated digital camera system along with the events which cause the states to change. The system starts in standby mode. The sequence of pictures is taken when in active mode.

Current stateEventNext state
standby modeturn ondetect mode
detect modeturn offstandby mode
detect modemovement detectedactive mode
active mode20 seconds elapsedsequence complete
active modeturn offstandby mode
sequence completetime saveddetect mode
Figure 1 of 1 for question 5
a

Complete the state-transition diagram for the automated digital camera system.

[4]
b

At the end of each sequence of pictures, the time is saved as a string in the format <HH><MM><SS> where: • HH represents the hours using two digits • MM represents the minutes using two digits • SS represents the seconds using two digits. For example: • "081230" is stored to represent the time 8:12:30, in the morning • "152235" is stored to represent the time 15:22:35, in the afternoon. Each string is stored on a new line in the text file TimeTaken.txt An algorithm is required to process the content of the text file TimeTaken.txt once it has been transferred to the computer. For each hour when pictures are taken, output a suitable message showing the hour and the total number of sequences of pictures taken within that hour. Example outputs: Hour : 15 Total : 32 Hour : 18 Total : 1 Write pseudocode for this algorithm. Assume the text file TimeTaken.txt contains at least one line.

[8]
6

Two arrays Data and Pointer are accessed by the procedure Place() Data and Pointer are both global arrays of type INTEGER The contents of these two arrays are shown:

DataPointer
1101817
2100723
3101031
4105646
510925-1
6106265
7103474
8089
90910
10010-1

Study the pseudocode: PROCEDURE Place(Value : INTEGER, Start : INTEGER, Unused : INTEGER) DECLARE New, Current, Last : INTEGER CONSTANT NullPointer = -1 New ← Unused Last ← NullPointer Current ← Start WHILE Current <> NullPointer AND Data[Current] < Value Last ← Current Current ← Pointer[Current] ENDWHILE Pointer[New] ← Pointer[Last] Pointer[Last] ← New Data[New] ← Value ENDPROCEDURE

a(i)

Complete the trace table below by dry running the procedure Place() when it is called by the statement: CALL Place(1043, 2, 8)

[4]
a(ii)

Complete the diagram showing the contents of the global arrays Data and Pointer after the procedure Place() has run to completion when called as shown in part (a)(i).

[3]
b

The operation carried out by procedure Place() together with the arrays form part of the implementation of an Abstract Data Type (ADT). Identify the ADT and state the operation carried out by procedure Place()

[2]
7

A program is being developed to implement a customer loyalty scheme for a coffee shop. Each customer has a unique customer ID starting at 10001 with this value increasing by one each time a new customer joins the loyalty scheme. For example, the third customer who joins the loyalty scheme is given the customer ID 10003 The loyalty scheme is limited to 1000 customers. A customer is awarded a loyalty point every time they buy a coffee. The programmer has decided to use a global 2D array Loyalty of type INTEGER. The array Loyalty is made up of 1000 rows and 2 columns. Each row relates to one customer; column 1 contains the unique customer ID and column 2 contains the number of customer loyalty points. Rows in the array Loyalty that are not currently being used have the value of Column 1 set to 99999 The array is sorted in ascending order by customer ID.

a

The programmer has defined a program module:

ModuleDescription
FindCustomer()• called with parameter of type INTEGER representing a customer ID
• searches the Loyalty array for this customer ID
• the search will stop as soon as the customer ID is found
• the search should efficiently deal with the situation when the customer ID is not stored in the Loyalty array
• if the customer ID is found, return an integer value representing the loyalty points, otherwise return -1

Write efficient pseudocode for module FindCustomer()

[8]
b

A customer can claim a free coffee for every 11 loyalty points. The programmer has defined a second program module:

ModuleDescription
PointsReport()• output the customer ID for each customer who has 11 or more loyalty points
• output the average loyalty points for all customers in the Loyalty array along with an appropriate message

Write efficient pseudocode for module PointsReport() Assume the array contains the data for at least one customer.

[7]
c(i)

The programmer decides to amend the customer ID; it will be stored as a STRING instead of an INTEGER. This means that the 2D array Loyalty can no longer be used. Explain why the 2D array Loyalty can no longer be used.

[1]
c(ii)

Explain how a 1D array could be used to store both the loyalty points and the amended customer ID.

[2]

Mark scheme

9618/22 · May/June 2025

Download PDF

1a(i) · 1 mark

  • 1 mark

    Choice of program development cycle depends on the approach/method required to produce the program OR a factor that would influence the choice of program development cycle (e.g. Rapid development of program/prototypes required, Need for prototypes (at an early stage), Complexity of problem, Skills / experience of development team / programmer(s), Budget / Time / Resources available, Size of development team, Developer / programmer can return to earlier stages / any stage, Avoidance of repeating previous stages in development of program, How much involvement clients will have, Allows the (program) requirements to be changed during program development, (Program) requirements agreed at start of development of program)

1a(ii) · 1 mark

  • 1 mark

    Which programming language would best be suited to control the production line // Which programming language would best suit the problem being solved

1b(i) · 3 marks

  • 1 mark

    Change to (production line) requirements

  • 1 mark

    New technology / hardware available (to control production line)

  • 1 mark

    Changes made to library modules used

  • 1 mark

    Change in relevant legislation

1b(ii) · 1 mark

  • 1 mark

    Perfective // Corrective

1c · 4 marks

  • 1 mark

    RIGHT(MachineCode, 4): STRING

  • 1 mark

    Speed * 2.5: REAL

  • 1 mark

    NOT Status: BOOLEAN

  • 1 mark

    IS_NUM(Check): BOOLEAN

1d(i) · 1 mark

  • 1 mark

    Two / 2

1d(ii) · 1 mark

  • 1 mark

    1000

1d(iii) · 2 marks

  • 1 mark

    Correct upper and lower bound: [0:99, 0:9]

  • 1 mark

    All other parts of declaration: DECLARE Product : ARRAY [0:99, 0:9] OF INTEGER

2a · 2 marks

  • 1 mark

    To increase the level of detail of the algorithm // To break the problem / task into smaller steps …

  • 1 mark

    … until steps can be directly translated into lines of code // from which it can be programmed

2b(i) · 2 marks

  • 1 mark

    Hours worked between 1 and 40 inclusive, Sales value <= 2000, Bonus Pay: 0

  • 1 mark

    Hours worked above 40, Sales value <= 2000, Bonus Pay: 10

  • 1 mark

    Hours worked between 1 and 40 inclusive, Sales value > 2000, Bonus Pay: 50

  • 1 mark

    Hours worked above 40, Sales value above 2000, Bonus Pay: 100

2b(ii) · 2 marks

  • 1 mark

    Simple modules are written to replace each of the unfinished modules.

  • 1 mark

    Each simple module will return an expected value / will output a message to show it has been called.

2b(iii) · 2 marks

  • 1 mark

    Type of error: Logic (error) OR Run-time (error)

  • 1 mark

    Corresponding description: Where the program does not behave as expected / Does not give expected result / An error in the logic of the algorithm (for Logic) OR The program performs an illegal operation (for Run-time)

3 · 8 marks

  • 1 mark

    Declare all variables used

  • 1 mark

    Use RAND() function with any integer parameter

  • 1 mark

    Use INT() function with any numeric parameter

  • 1 mark

    Conditional loop until two different random numbers are generated

  • 1 mark

    Use INT() function using random number generated between -10 and 10 inclusive in a loop

  • 1 mark

    Output two different random integers / numbers

  • 1 mark

    Check if both random integers / numbers are negative

  • 1 mark

    then output a (third) random integer / number between 30 and 35 inclusive

4 · 6 marks

  • 1 mark

    Initialise Index used for Number to either 1 or 0 before first loop

  • 1 mark

    Loop 100 times

  • 1 mark

    Input value

  • 1 mark

    Increment array index and store value in Number array at element referenced by array index in a loop

  • 1 mark

    Output loop starts at last element in Number array

  • 1 mark

    Output Number array element referenced by Index in a loop

  • 1 mark

    Output all elements of Number array once in reverse order

5a · 4 marks

  • 1 mark

    The three new states drawn and labelled.

  • 1 mark

    Two of the events drawn with labels connecting correct states and correct line direction

  • 1 mark

    Four of the events drawn with labels connecting correct states and correct line direction.

  • 1 mark

    All and only six events drawn with labels connecting correct states and correct line direction.

5b · 8 marks

  • 1 mark

    Any Initialisation of count for number of pictures taken each hour // Initialisation of 24 array elements to 0 // Initialisation of 24 Integer variables to 0

  • 1 mark

    Open "TimeTaken.txt" for read and subsequently close

  • 1 mark

    Conditional loop until EOF

  • 1 mark

    Read a line from "TimeTaken.txt" in a loop

  • 1 mark

    Extract Hour from line read in a loop

  • 1 mark

    A mechanism to compare current hour extracted from file with last one read from file in a loop // Convert Hour to an integer value in a loop

  • 1 mark

    If hours same increment count in a loop // Increment appropriate array element / variable in a loop

  • 1 mark

    If not same output count (with a suitable message) and update Hour <- NextHour and set Count to 1 in a loop // Output of each hour and corresponding count variable (with a suitable message) for all values where count is not zero

6a(i) · 4 marks

  • 1 mark

    Region 1: Value=1043, Start=2, Unused=8, New=8, Last=-1, Current=2

  • 1 mark

    Region 2: Last=2, Current=3

  • 1 mark

    Region 3: Last=3, Current=1

  • 1 mark

    Region 4: Last=1, Current=7 and Last=7, Current=4

6a(ii) · 3 marks

  • 1 mark

    Global array Data row 8 containing the value 1043

  • 1 mark

    Global array Pointer row 7 containing the value 8 and row 8 containing the value 4

  • 1 mark

    All other rows in both arrays

6b · 2 marks

  • 1 mark

    Identifying the ADT as a linked list

  • 1 mark

    Identifying operation as inserting / adding a value / node into a linked list

7a · 8 marks

  • 1 mark

    Create function header and ending with correct parameter and return type

  • 1 mark

    Check CustomerID is in range / within range and if not return -1

  • 1 mark

    (Conditional) loop iterating through each element in array / FOR Loop / Conditional loop that halves array search space with each iteration

  • 1 mark

    Check for current element in array contains required customer ID in a loop

  • 1 mark

    If found set value to terminate loop / return loyalty points / Mechanism to end loop if CustomerID is found in array in a loop

  • 1 mark

    Terminating loop when customer ID found

  • 1 mark

    Terminating loop when current customer ID is 99999 / Mechanism to end loop if CustomerID is not in array in a loop

  • 1 mark

    Return either loyalty points for the customer found or -1 if not found

7b · 7 marks

  • 1 mark

    Create procedure header and ending

  • 1 mark

    Declare and initialise Index, Sum and Count

  • 1 mark

    Loop through all elements in Loyalty array

  • 1 mark

    … or terminates when column1 of Loyalty array equals 99999 in a loop

  • 1 mark

    Check if loyalty points greater than or equal to 11 in a loop

  • 1 mark

    If true output customer ID

  • 1 mark

    Sum points and Increment Count in a loop

7c(i) · 1 mark

  • 1 mark

    An array can only store data of the same type // An array cannot store data of different types

7c(ii) · 2 marks

  • 1 mark

    a new (composite) data type / record is defined (that consists of both INTEGER and STRING) // Converting loyalty points to string and concatenating / joining / append with Customer ID

  • 1 mark

    an array based on this new type is declared // Storing concatenated string in an array of string

Questions

  1. 1
    Question 114 marks
    Mark scheme ›
  2. 2
    Question 28 marks
    Mark scheme ›
  3. 3
    Question 38 marks
    Mark scheme ›
  4. 4
    Question 46 marks
    Mark scheme ›
  5. 5
    Question 512 marks
    Mark scheme ›
  6. 6
    Question 69 marks
    Mark scheme ›
  7. 7
    Question 718 marks
    Mark scheme ›

More 9618 papers

Other papers from May/June 2025

Solve it on ExamPalStart