A Level Computer Science 9618 Paper 23, Oct/Nov 2024

Question paper and mark scheme75 marks8 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.

Papers open in

Opening the question paper

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

Question paper

9618/23 · Oct/Nov 2024

Download PDF
1

Refer to the insert for the list of pseudocode functions and operators.

a

The following table contains pseudocode examples. Each example may contain statements that relate to one or more of the following: • selection • iteration (repetition) • subroutine (procedure or function). Complete the table by placing one or more ticks ('✓') in each row.

Pseudocode exampleSelectionIterationSubroutine
FOR Index ← 1 TO 3<br> IF Safe[Index] = TRUE THEN<br> Flap[Index] ← 0<br> ENDIF<br>NEXT Index
CASE OF Compound(3)
REPEAT UNTIL AllDone() = TRUE
WHILE Result[3] <> FALSE
[4]
b

Complete the table by giving the appropriate data type in each case.

VariableExample data valueData type
AvailableTRUE
Received"18/04/2021"
Index100
[3]
c

Evaluate each expression in the table by using the data values shown in part (b). Write ‘ERROR’ if the expression contains an error.

ExpressionEvaluates to
Available AND NOT(Index > 100)
Index MOD 30
NUM_TO_STR(Index + "33")
[3]
2

An algorithm will: 1. prompt and input a sequence of 100 integer values, one at a time 2. sum the positive integers 3. output the result of the sum.

a

Write pseudocode for the algorithm. Assume the value zero is neither positive nor negative. You must declare all variables used in the algorithm.

[5]
b

The algorithm requires the use of basic constructs. One of these is sequence. Identify one other basic construct required by the algorithm and describe how it is used. Construct .................................................................................................................................. Use ...........................................................................................................................................

[2]
3

The implementation of a linked list uses an integer variable and a 1D array List of type Node. Record type Node is declared in pseudocode as follows: TYPE Node DECLARE Data : STRING DECLARE Pointer : INTEGER ENDTYPE The array List is declared in pseudocode as follows: DECLARE List : ARRAY[1:200] OF Node The linked list will operate as follows: • Integer variable HeadPointer will store the array index for the first node in the linked list. • The Pointer field of a node contains the index value of the next array element (the next node) in the linked list. • The value 0 is used as a null pointer.

Figure 1 of 2 for question 3
Figure 2 of 2 for question 3
a(i)

State why the value 0 has been selected as the null pointer.

[1]
a(ii)

Give the range of valid values that could be assigned to variable HeadPointer.

[1]
b

The array List will be initialised so that each node points to the following node. The last node will contain a null pointer. Complete the program flowchart to represent the algorithm for this operation.

[4]
c

An algorithm outputs the Data field from all nodes in the array List. The order the Data is output should be the same order it is stored in the linked list. Describe the algorithm in four steps. Do not use pseudocode statements in your answer. Step 1 ....................................................................................................................................... Step 2 ....................................................................................................................................... Step 3 ....................................................................................................................................... Step 4 .......................................................................................................................................

[4]
4

An examination 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. A program is being written to process examination marks. The five grade boundaries are stored in a global 1D array GB of type INTEGER, for example:

IndexValueComment
165The minimum mark for an A grade.
257The minimum mark for a B grade.
343The minimum mark for a C grade.
435The minimum mark for a D grade.
527The minimum mark for an E grade.

Any paper that achieves a mark within 2 marks of a grade boundary must be checked. Using the given table, a paper with 45 marks would need to be checked.

a

The pseudocode algorithm to determine whether a paper should be checked is as shown. The mark for the paper is stored in variable Mark. Global variables Mark, Index, Upper and Lower are declared as integers. Complete the pseudocode. FOR Index ← 1 TO ........................................... Lower ← GB[Index] - 2 Upper ← ....................................................... IF Mark ........................................... AND Mark ........................................... THEN OUTPUT "Check this paper" ENDIF NEXT Index

[4]
b(i)

An alternative algorithm to determine if a paper needs to be checked uses a global 1D array Check, containing 76 elements of type BOOLEAN. The indices of the array are from 0 to 75 (inclusive), corresponding to the range of possible marks. An element value in Check is TRUE if the index is within 2 marks of a grade boundary. For example, in the case where the C grade boundary is 43 the corresponding part of the Check array would be as follows:

IndexValue
40FALSE
41TRUE
42TRUE

| 43 | TRUE | ← The grade boundary for a C grade | 44 | TRUE | | 45 | TRUE | | 46 | FALSE | The mark for a given paper is stored in variable Mark. Describe how an algorithm would use the Check array to determine whether this paper should be checked.

[2]
b(ii)

A procedure GBInitialise() will initialise the Check array using values from the GB array. Note it can be assumed that the maximum grade boundary value for A is 70 and the minimum value for E is 15. Write pseudocode for the procedure.

[6]
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.

ActivityName of life cycle stage
A compiler is used.
A program that has been released for general use is modified.
The dry run method is used.
The program structure is specified.
[4]
b

A software developer has written modules Test_A() and Test_B(). These have been written but contain errors. These modules are called from several places in the main program and testing of the main program (integration testing) has to stop. Identify a method that can be used to continue testing the main program before the errors in these modules have been corrected and describe how this would work. Method ...................................................................................................................... Description ................................................................................................................

[3]
6

In some countries, on the third Sunday in March, daylight saving time begins when clocks move forward by one hour. A module AdjustClock() will take an integer parameter representing a year. The module will return an integer value representing the number of the day in March on which the clocks move forward. For example, the following line of pseudocode would assign DayNumber the value 20: DayNumber ← AdjustClock(2022) Write pseudocode for the function AdjustClock(). Date functions from the insert should be used in your solution.

[7]
7

A coffee shop owner wants to introduce a computerised loyalty card system. A programmer discusses the details of the system with the shop owner.

a

Identify the stage of the program development life cycle that this discussion is part of and give a document that will be produced during this stage. Stage ........................................................................................................................................ Document .................................................................................................................................

[2]
b

The shop will give each customer a loyalty card that displays a unique customer ID as a bar code. A customer will be able to present their card each time they make a purchase. The system will scan the bar code, calculate points, and add them to the customer’s total. When the customer next makes a purchase and presents their card, they will have the option to exchange points for a discount. The designer decides that this activity will be handled by a new module. Decomposition will be used to break the problem of designing the new module down into sub-problems (sub-modules). Identify four sub-modules that could be used in the design of the new module and describe their use. Sub-module 1 ........................................................................................................................... Use ........................................................................................................................................... Sub-module 2 ........................................................................................................................... Use ........................................................................................................................................... Sub-module 3 ........................................................................................................................... Use ........................................................................................................................................... Sub-module 4 ........................................................................................................................... Use ...........................................................................................................................................

[4]
8

A program is being developed to implement a game for up to six players. During the game, each player assembles a team of characters. At the start of the game there are 45 characters available. Each character has four attributes, as follows:

AttributeExamplesComment
Player0, 1, 3The player the character is assigned to.
RoleBuilder, Teacher, DoctorThe job that the character will perform in the game.
NameBill, Lee, Farah, MoThe name of the character. Several characters may perform the same role, but they will each have a unique name.
Skill level14, 23, 76An integer in the range 0 to 100, inclusive.

The programmer has defined a record type to define each character. The record type definition is shown in pseudocode as follows: TYPE CharacterType DECLARE Player : INTEGER DECLARE Role : STRING DECLARE Name : STRING DECLARE SkillLevel : INTEGER ENDTYPE The Player field indicates the player to which the character is assigned (1 to 6). This field value is 0 if the character is not assigned to any player. The programmer has defined a global array to store the character data, as follows: DECLARE Character : ARRAY[1:45] OF CharacterType At the start of the game all record fields are initialised, and all Player fields are set to 0 The programmer has defined a program module as follows:

ModuleDescription
Count()• called with two parameters:<br> ○ an integer representing a player<br> ○ a string representing a character role<br>• searches the Character array for characters with the given role that are assigned to the given player<br>• counts the number of assigned characters and sums their total skill level<br>• outputs the result of the search if characters with the given role are found, for example:<br> "Player 3 has 4 characters with the role of Teacher and the total skill level is 65"<br>• if no characters with the given role are found, outputs:<br> "No characters with that role are assigned to this player"
a

Complete the pseudocode for module Count(). PROCEDURE Count(ThisPlayer : INTEGER, ThisRole : STRING) ENDPROCEDURE

[7]
b

The Character array data has been saved in the text file SaveFile.txt Each line of the file contains one element of the array (one record). New modules are defined:

ModuleDescription
Extract()<br>(already written)• called with two parameters:<br> ○ a string representing a complete line from the text file<br> ○ an integer representing a field number (see structure below)<br>• returns a string representing the required field
Restore()• opens the text file SaveFile.txt<br>• reads lines from the file and assigns values to each record in the Character array using data from each line of the file

As a reminder, the record structure is repeated here: TYPE CharacterType DECLARE Player : INTEGER //Field number 1 DECLARE Role : STRING //Field number 2 DECLARE Name : STRING //Field number 3 DECLARE SkillLevel : INTEGER //Field number 4 ENDTYPE Write pseudocode for module Restore(). You must use the module Extract().

[7]
c

The game can last for several days and users often find that they have to close and rerun the game program many times in order to complete it. Describe the benefit of using the file SaveFile.txt as described in part (b).

[2]

Mark scheme

9618/23 · Oct/Nov 2024

Download PDF

1a · 4 marks

  • 1 mark

    Row 1: FOR Index ← 1 TO 3 ... (Selection and Iteration ticked)

  • 1 mark

    Row 2: CASE OF Compound(3) (Selection and Subroutine ticked)

  • 1 mark

    Row 3: REPEAT UNTIL AllDone() = TRUE (Iteration and Subroutine ticked)

  • 1 mark

    Row 4: WHILE Result[3] <> FALSE (Iteration ticked)

1b · 3 marks

  • 1 mark

    Row 1: Available | TRUE | BOOLEAN

  • 1 mark

    Row 2: Received | "18/04/2021" | STRING

  • 1 mark

    Row 3: Index | 100 | INTEGER

1c · 3 marks

  • 1 mark

    Available AND NOT(Index > 100) evaluates to TRUE

  • 1 mark

    Index MOD 30 evaluates to 10

  • 1 mark

    NUM_TO_STR(Index + "33") evaluates to ERROR

2a · 5 marks

  • 1 mark

    Declarations of all variables used

  • 1 mark

    Loop for 100 iterations

  • 1 mark

    Prompt and input a value in a loop and

  • 1 mark

    Test for value > 0 // >=1 in a loop

  • 1 mark

    Sum the Total in a loop

2b · 2 marks

  • 1 mark

    Construct: Iteration / Repetition

  • 1 mark

    Use: To loop through all 100 inputs // To loop 100 times

3a(i) · 1 mark

  • 1 mark

    0 is not a valid array / List index value // No 0^th element in the array

3a(ii) · 1 mark

  • 1 mark

    0 to 200

3b · 4 marks

  • 1 mark

    Use of variable as array index and initialisation to 1 / to first element of array

  • 1 mark

    Loop for 199 / 200 iterations

  • 1 mark

    Assign Index+1 to each pointer field in a loop

  • 1 mark

    Assign 0 to 200th pointer field

3c · 4 marks

  • 1 mark

    Assign HeadPointer to ThisPointer / Current Pointer // Identify first node using headpointer

  • 1 mark

    Loop the following until ThisPointer value is 0 (zero) / null pointer reached

  • 1 mark

    … Output data (field) from array element at index ThisPointer // Output data (field) of the current node / array element

  • 1 mark

    … Assign pointer field from current array element / index / to ThisPointer / Current Pointer // Assign pointer field from current node to ThisPointer / Current Pointer

4a · 4 marks

  • 1 mark

    1 TO 5

  • 1 mark

    GB[Index] - 2

  • 1 mark

    GB[Index] + 2 // Lower + 4

  • 1 mark

    Mark >= Lower AND Mark <= Upper // Mark <= Upper AND Mark >= Lower

4b(i) · 2 marks

  • 1 mark

    Use Mark as the index to the Check array // to specify an array element

  • 1 mark

    If value of indexed element is TRUE, then the paper will need to be checked

4b(ii) · 6 marks

  • 1 mark

    Procedure heading and ending

  • 1 mark

    Initialise Check array to FALSE

  • 1 mark

    Loop through GB array

  • 1 mark

    Extract the GB mark

  • 1 mark

    Loop for 5 elements across GBMark ± 2 // Check if within GBMark ± 2

  • 1 mark

    Assign each element of Check array to TRUE

5a · 4 marks

  • 1 mark

    A compiler is be used. -> Coding

  • 1 mark

    A program that has been released for general use is modified -> Maintenance

  • 1 mark

    The dry run method is used. -> Testing

  • 1 mark

    The program structure is specified. -> Design

5b · 3 marks

  • 1 mark

    Stub testing

  • 1 mark

    The modules Test_A() and Test_B()are replaced by dummy modules

  • 1 mark

    ... which return a known result // An output statement is displayed when called (to check it works) // gives expected output

6 · 7 marks

  • 1 mark

    Function heading, parameter, ending and return type

  • 1 mark

    Declare local integer variable that is used to create a date / hold a day number

  • 1 mark

    Loop until 3rd Sunday found

  • 1 mark

    Attempt to use both SETDATE() and DAYINDEX() in a loop

  • 1 mark

    Correctly generate value of type DATE using SETDATE() in a loop

  • 1 mark

    Test if value represents a Sunday using DAYINDEX() in a loop

  • 1 mark

    Increment Sunday count in a loop and initialised correctly before loop

7a · 2 marks

  • 1 mark

    Analysis

  • 1 mark

    Named document, examples include: A requirement specification / Definition of System Objectives / List of problems with existing system / Survey results / Feasibility study / Interview notes

7b · 4 marks

  • 1 mark

    Sub-module 1 name and use

  • 1 mark

    Sub-module 2 name and use

  • 1 mark

    Sub-module 3 name and use

  • 1 mark

    Sub-module 4 name and use

8a · 7 marks

  • 1 mark

    Initialisation of local integers for Num and Total

  • 1 mark

    Loop through 45 elements

  • 1 mark

    Attempt to check Player and Role fields in a loop

  • 1 mark

    Correctly compare Player field with parameter in a loop

  • 1 mark

    Correctly compare Role field with parameter in a loop

  • 1 mark

    ... if player and role found, increment Num and sum Skill Total in a loop

  • 1 mark

    Test for any matches after the loop

8b · 7 marks

  • 1 mark

    Open the file in read mode and subsequently close

  • 1 mark

    Loop through 45 elements

  • 1 mark

    Read a line from the file in a loop

  • 1 mark

    Attempt to use Extract() in a loop

  • 1 mark

    Correct use of Extract() for all fields in a loop

  • 1 mark

    Use of STR_TO_NUM() on Player and Skill in a loop

  • 1 mark

    Completely correct extraction and assignment of all fields in a loop

8c · 2 marks

  • 1 mark

    The Character array / character data can be saved before the program is closed

  • 1 mark

    Allowing the game to continue using the same data / from the point it was saved

Questions

  1. 1
    Question 110 marks
    Mark scheme ›
  2. 2
    Question 27 marks
    Mark scheme ›
  3. 3
    Question 310 marks
    Mark scheme ›
  4. 4
    Question 412 marks
    Mark scheme ›
  5. 5
    Question 57 marks
    Mark scheme ›
  6. 6
    Question 67 marks
    Mark scheme ›
  7. 7
    Question 76 marks
    Mark scheme ›
  8. 8
    Question 816 marks
    Mark scheme ›

More 9618 papers

Other papers from Oct/Nov 2024

Solve it on ExamPalStart