A Level Computer Science 9618 Paper 21, May/June 2023

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/21 · May/June 2023

Download PDF
1

Refer to the insert for the list of pseudocode functions and operators. A programmer has written a program which includes the function Calculate(). When the program is run, the function returns an unexpected value.

a

Describe how a typical Integrated Development Environment (IDE) could be used to help debug the program to find the errors in the function Calculate().

[4]
b

The algorithm for function Calculate() contains the three pseudocode statements shown. Describe the error in each statement or write 'no error' if the statement contains no error. Assume any variables used are of the correct type for the given function. Statement 1: Index ← STR_TO_NUM(("27") + 2) Error .......................................................................................................................................... ................................................................................................................................................... Statement 2: Index ← STR_TO_NUM(MID("CPE1704TKS", 4, 2)) Error .......................................................................................................................................... ................................................................................................................................................... Statement 3: IF MONTH(ThisDate) > '6' THEN Error .......................................................................................................................................... ...................................................................................................................................................

[3]
c(i)

The program contains variables with values as follows: Variable | Value Active | TRUE Points | 75 Exempt | FALSE Complete the table by evaluating each expression. Expression | Evaluation 1 | (Points > 99) OR Active 2 | (Points MOD 2 = 0) OR Exempt 3 | (Points <= 75) AND (Active OR Exempt) 4 | (Active OR NOT Active) AND NOT Exempt

[2]
c(ii)

Write expression 4 from the table in part (c)(i) in its simplest form.

[1]
2

A program contains an algorithm to output a string of a specified length containing identical characters.

Figure 1 of 1 for question 2
a

The algorithm is described as follows: 1. prompt and input a character and store in MyChar 2. prompt and input an integer and store in MyCount 3. generate a string consisting of MyChar repeated MyCount times 4. output the string. Draw a program flowchart to represent the algorithm.

[4]
b

A different part of the program uses the variable StartDate. Write pseudocode statements to declare StartDate and assign to it the date corresponding to 15/11/2005. Declaration ............................................................................................................................... Assignment ...............................................................................................................................

[3]
3

Customers collect points every time they make a purchase at a store. A program is used to manage the points system and the table lists some of the information stored for one customer. Information | Data type required Name | String Number of points collected | Integer Date of birth | Date

a(i)

Identify a suitable structure for storing the information for one customer. Explain the advantage of using this structure. Structure ............................................................................................................................ Advantage .........................................................................................................................

[4]
a(ii)

Describe a data structure that could be used to store the information for all customers.

[2]
b

Customers receive points depending on the amount they spend. The number of points depends on the band that the amount falls into: Band | Amount | Points 1 | Less than 10∣5perwholedollar() 2 | Between $10 and 100inclusive∣7perwholedollar() 3 | Over 100∣10perwholedollar() For example, if the amount is $99.77, this amount is in band 2 and therefore the number of points is 7 × 99, which is 693 points. The algorithm to calculate the points from a given amount is expressed as follows: • work out the appropriate band • calculate and output the number of points. Apply the process of stepwise refinement to increase the detail of the algorithm. Structure your algorithm into a sequence of five steps that could be used to produce pseudocode. Write the five steps.

[5]
4

Function Replace() will: 1. take three parameters: • a string (the original string) • a char (the original character) • a char (the new character) 2. form a new string from the original string where all instances of the original character are replaced by the new character 3. return the new string. Write pseudocode for function Replace().

[6]
5

Several companies are developing websites to market a new type of games console. The company that is first to create a website that can demonstrate the interactive features of the games console will have an advantage over the others. The requirements for the website are likely to change as more information about the features of the console are made available. One company has decided to develop their website using a program development life cycle based on the waterfall model.

a(i)

Give two reasons why this may not be the most appropriate model to use in this case. Reason 1 ........................................................................................................................... Reason 2 ...........................................................................................................................

[2]
a(ii)

Identify a more appropriate program development life cycle model for this scenario.

[1]
b

The website has been running in test mode for several weeks. Identify and describe a final stage of testing that should take place before the website is made available to all customers. Stage ........................................................................................................................................ Description ................................................................................................................................

[3]
6

A video-conferencing program supports up to six users. Speech from each user is sampled and digitised (converted from analogue to digital). Digitised values are stored in array Sample. The array Sample consists of 6 rows by 128 columns and is of type integer. Each row contains 128 digitised sound samples from one user. The digitised sound samples from each user are to be processed to produce a single value which will be stored in a 1D array Result of type integer. This process will be implemented by procedure Mix(). A procedure Mix() will: • calculate the average of each of the 6 sound samples in a column • ignore sound sample values of 10 or less • store the average value in the corresponding position in Result • repeat for each column in array Sample The diagram uses example values to illustrate the process: [Diagram] Write pseudocode for procedure Mix(). Assume Sample and Result are global.

[6]
Figure 1 of 2 for question 6
Figure 2 of 2 for question 6
7

A school has a computerised library system that allows students to borrow books for a fixed length of time. The system uses text files to store details of students, books and loans. A new module is to be written which will generate emails to each student who has an overdue book.

Figure 1 of 1 for question 7
a

Decomposition will be used to break down the problem of designing the new module 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]
b(i)

The program designer produces a structure chart for the new module. Part of the structure chart is shown: [Structure Chart] Explain the relationship between the four modules shown.

[2]
b(ii)

Two new modules are added: Module-X() and Module-Y(). • Module-X() has no parameters. • Module-Y() will take a string and a real number as parameters and return a Boolean value. • Module-D() will call either Module-X() or Module-Y(). Draw only the part of the structure chart that represents the relationship between Module-X(), Module-Y() and Module-D().

[3]
8

A computer shop assembles computers using items bought from several suppliers. A text file Stock.txt contains information about each item. Information for each item is stored as a single line in the Stock.txt file in the format: <ItemNum><SupplierCode><Description> Item information is as follows: Format | Comment ItemNum | 4 numeric characters | unique for each item in the range "0001" to "5999" inclusive SupplierCode | 5 alphabetic characters | to identify the supplier of the item Description | a string | a minimum of 12 characters The file is organised in ascending order of ItemNum and does not contain all possible values in the range. A programmer has started to define program modules as follows: Module | Description SuppExists() (already written) | • called with a parameter of type string representing a supplier code • returns TRUE if the supplier code is already in use, otherwise returns FALSE IsNewSupp() | • called with a parameter of type string representing a new supplier code • returns TRUE if the string only contains alphabetic characters (either upper or lower case) and the supplier code is not already in use, otherwise returns FALSE

a

Write pseudocode for module IsNewSupp(). Module SuppExists() has already been written and should be used as part of your solution. Module SuppExists() will generate a run-time error if the given parameter is not 5 characters in length.

[7]
b

A new module has been defined: Module | Description CheckNewItem() | • called with a parameter of type string representing a line of item information • checks to see whether an item with the same ItemNum already exists in the file • returns TRUE if the ItemNum is not already in the file, otherwise returns FALSE Write efficient pseudocode for module CheckNewItem().

[7]
c(i)

The program modules SuppExists(), IsNewSupp() and CheckNewItem() are part of a group of modules that are combined to create a complete stock control program. Each module in the program is tested individually during development and is debugged as necessary. It is then added to the program and further testing performed. Identify this method of testing.

[1]
c(ii)

One of the modules does not work properly when it is added to the program. Describe a testing method that can be used to address this problem so that testing can continue and other modules can be added.

[2]
d

A new module AddItem() will be used to add information to the Stock.txt file. State the file mode that should be used for the algorithm within this module.

[1]
e

A new module FindItem() searches for a given item in the Stock.txt file, which is already organised in ascending order of ItemNum. Describe how this organisation may improve the efficiency of the algorithm.

[3]

Mark scheme

9618/21 · May/June 2023

Download PDF

1a · 4 marks

  • 1 mark

    breakpoint: stop the program at a particular point / instruction

  • 1 mark

    report/watch window: value of variables could be checked

  • 1 mark

    single stepping: execute one statement/line at a time

  • 1 mark

    Fourth mark for term or explanation

1b · 3 marks

  • 1 mark

    Error 1: Brackets mismatch // 2/value should be added after brackets/function // Addition between a string and a number is not valid // STR_TO_NUM / the function needs to be passed a string / not an integer

  • 1 mark

    Error 2: No Error

  • 1 mark

    Error 3: MONTH() returns an integer and this is being compared with a character/string // Integer cannot be compared to a string // 6 should not be in quotes

1c(i) · 2 marks

  • 1 mark

    Any two rows correct

  • 1 mark

    All rows correct

1c(ii) · 1 mark

  • 1 mark

    NOT Exempt

2a · 4 marks

  • 1 mark

    Both prompts

  • 1 mark

    Both inputs using correct identifiers as given in question, MyChar and MyCount

  • 1 mark

    Initialise MyString to empty string and subsequent output after loop

  • 1 mark

    Loop MyCount iterations including decrement MyCount

2b · 3 marks

  • 1 mark

    DECLARE StartDate : DATE

  • 1 mark

    First underlined parameter in SETDATE (15)

  • 1 mark

    Remaining underlined parameters in SETDATE (11, 2005)

3a(i) · 4 marks

  • 1 mark

    Structure: Record

  • 1 mark

    Advantage: A set of data / all data related to one customer

  • 1 mark

    Advantage: of different types

  • 1 mark

    Advantage: is held under a single identifier/entity

3a(ii) · 2 marks

  • 1 mark

    array

  • 1 mark

    records // type

3b · 5 marks

  • 1 mark

    Reference to the use of constants or variables for the two threshold values of 10 and 100 // Input amount spent (by customer and store in a numeric variable)

  • 1 mark

    Work out one band that amount maps to

  • 1 mark

    Work out all bands that amount maps to

  • 1 mark

    Calculate rounded value of amount / whole number part of amount

  • 1 mark

    Calculate the points by multiplying the (rounded) amount by the appropriate value for appropriate band /all bands

4 · 6 marks

  • 1 mark

    Function heading and ending, including parameters and return type

  • 1 mark

    Declaration of local variables used including loop counter

  • 1 mark

    Loop for length of OldString

  • 1 mark

    Extract char and test in a loop

  • 1 mark

    Use of concatenate to build NewString replace char if necessary, in a loop

  • 1 mark

    Return NewString after reasonable attempt

5a(i) · 2 marks

  • 1 mark

    No working software until late in the life cycle so slower to market than competitors // Does not allow the creation of early versions/prototypes (which can be updated later)

  • 1 mark

    More difficult/slower to cope with changes to the requirements // website slower to be updated to reflect new requirements // Needs high involvement/feedback of the stake holders /customer / client

5a(ii) · 1 mark

  • 1 mark

    Iterative / Rapid Application Development / RAD

5b · 3 marks

  • 1 mark

    Stage: Beta testing

  • 1 mark

    Description point 1: Testing carried out by a small group of (potential) users // Description point 2: Users will check that the website/software works as required / works in the real world //User will identify errors in the website/software

  • 1 mark

    Description point 3: Users will feedback (problems) / suggestions for improvement // Description point 4: Problems / suggestions identified are addressed (before the program is sold)

6 · 6 marks

  • 1 mark

    Declaration and initialisation before inner loop of Count and Total

  • 1 mark

    Outer Loop for 128 iterations

  • 1 mark

    Inner loop for six iterations

  • 1 mark

    Test for sample > 10 in a loop

  • 1 mark

    and if true sum Total and increment Count

  • 1 mark

    Calculate average value and assign to Result array after inner loop and within outer loop // Use of INT()/ DIV to convert average to integer

7a · 3 marks

  • 1 mark

    Module 1: name and use

  • 1 mark

    Module 2: name and use

  • 1 mark

    Module 3: name and use

7b(i) · 2 marks

  • 1 mark

    Module-A calls the other three modules

  • 1 mark

    The process is repeated

7b(ii) · 3 marks

  • 1 mark

    All rectangles correctly labelled and interconnected

  • 1 mark

    All and only parameters as shown

  • 1 mark

    Selection diamond

8a · 7 marks

  • 1 mark

    Check ThisString is exactly 5 characters in length

  • 1 mark

    Use of SuppExists() with a string of 5 characters as a parameter

  • 1 mark

    Loop for 5 iterations // loops for length of string parameter

  • 1 mark

    Extract a character in a loop

  • 1 mark

    Test if char is alphabetic in a loop

  • 1 mark

    …catering for both upper and lower case

  • 1 mark

    Return Boolean following a reasonable attempt

8b · 7 marks

  • 1 mark

    Open Stock.txt in READ mode and subsequently close

  • 1 mark

    Extract NewItemNum from parameter

  • 1 mark

    Conditional loop until EOF("Stock.txt")

  • 1 mark

    ... OR NewItemNum found

  • 1 mark

    ... OR when ThisItemNum < NewItemNum

  • 1 mark

    Read a line from Stock.txt AND extract ThisItemNum in a loop

  • 1 mark

    If ThisItemNum = NewItemNum then terminate loop / set flag in a loop // Return Boolean after reasonable attempt

8c(i) · 1 mark

  • 1 mark

    Integration testing

8c(ii) · 2 marks

  • 1 mark

    A dummy/simple module is written to replace the module that does not work properly

  • 1 mark

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

8d · 1 mark

  • 1 mark

    Append

8e · 3 marks

  • 1 mark

    The algorithm / search / iteration can stop /only iterates

  • 1 mark

    if the current value read from the file // current line in file

  • 1 mark

    is greater than the value being searched for

Questions

  1. 1
    Question 110 marks
    Mark scheme ›
  2. 2
    Question 27 marks
    Mark scheme ›
  3. 3
    Question 311 marks
    Mark scheme ›
  4. 4
    Question 46 marks
    Mark scheme ›
  5. 5
    Question 56 marks
    Mark scheme ›
  6. 6
    Question 66 marks
    Mark scheme ›
  7. 7
    Question 78 marks
    Mark scheme ›
  8. 8
    Question 821 marks
    Mark scheme ›

More 9618 papers

Other papers from May/June 2023

Solve it on ExamPalStart