0% found this document useful (0 votes)
33 views72 pages

AQA CS 2024 Exam Questions Guide

The document contains a series of programming questions and tasks related to algorithms, data types, and program structure, specifically for a CS 2024 exam. It includes hand-tracing algorithms, coding tasks, and theoretical questions about programming concepts such as local vs global variables, structured programming, and subroutine functionality. The document is structured with sections for input, output, and specific programming tasks to be completed by students.

Uploaded by

KM Hedar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views72 pages

AQA CS 2024 Exam Questions Guide

The document contains a series of programming questions and tasks related to algorithms, data types, and program structure, specifically for a CS 2024 exam. It includes hand-tracing algorithms, coding tasks, and theoretical questions about programming concepts such as local vs global variables, structured programming, and subroutine functionality. The document is structured with sections for input, output, and specific programming tasks to be completed by students.

Uploaded by

KM Hedar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Name: ________________________

All CS 2024 Questions - AQA Class: ________________________

Date: ________________________

Time: 201 minutes

Marks: 146 marks

Comments:

GEMS Metropole School Page 1 of 72


1. S1 ← "011101"
S2 ← "001100"

C ← "0"

R ← ""
FOR J = 0 TO 5
X ←5-J
D1 ← S1[X]

D2 ← S2[X]
IF C = "0" THEN
IF D1 = D2 THEN
S ← "0"

C ← D1
ELSE
S "1"←
ENDIF
ELSE
IF D1 = D2 THEN
S ← "1"

C ← D1
ELSE
S ← "0"
ENDIF
ENDIF
R ←
CONCATENATE(S, R)
ENDFOR
OUTPUT R

The function CONCATENATE(X, Y) returns the string formed by concatenating the string Y to the
end of string X. For example, CONCATENATE("cat", "dog") returns "catdog".

The strings are zero index based.

GEMS Metropole School Page 2 of 72


Complete the table below by hand-tracing the algorithm in the figure above.

You may not need to use all the rows in the table.

You do not need to indicate that C, D1, D2 and S are strings.

The first row of the table has already been completed for you.

S1 S2 C R J X D1 D2 S

"011101" "001100" "0" ""

OUTPUT:

(Total 5 marks)

A program uses both local and global variables.


2.
(a) State two differences between local and global variables.

___________________________________________________________________

___________________________________________________________________

___________________________________________________________________

___________________________________________________________________
(2)

(b) Give two reasons why it is good practice to use local variables.

___________________________________________________________________

___________________________________________________________________

___________________________________________________________________

___________________________________________________________________
(2)
(Total 4 marks)

GEMS Metropole School Page 3 of 72


Programmers are encouraged to adopt a structured approach to writing programs.
3.
Explain three reasons for adopting the structured approach.

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________
(Total 3 marks)

The figure below shows an algorithm represented using pseudo-code.


4.
OUT_NOLF "Enter an integer: "
INPUT Number1
OUT_NOLF "Enter another integer: "
INPUT Number2
IF Number1 > Number2 THEN
Number ← Number1 DIV Number2
ELSE
Number ← Number2 DIV Number1
ENDIF
Count ← 0
WHILE Count ≠ Number
Count ← Count + 1
IF (Count MOD 10) = 0 THEN
OUT_NOLF "X"
ELSE
IF (Count MOD 5) = 0 THEN
OUT_NOLF "V"
ELSE
OUT_NOLF "/"
ENDIF
ENDIF
ENDWHILE

The OUT_NOLF command displays the output without a line feed. The following series of
OUT_NOLF commands will display ABC:

OUT_NOLF "A"
OUT_NOLF "B"
OUT_NOLF "C"

The table below lists the MOD and DIV operators for each of the available programming
languages. You should refer to the row for your programming language.

Programming language MOD DIV

C# % /

Java % /

Pascal mod div

Python % //

[Link] Mod \

GEMS Metropole School Page 4 of 72


What you need to do:

Task 1
Write a program to implement the algorithm in the figure above.

Task 2
Test that your program works:
• run your program
• enter 4
• enter 99

Evidence that you need to provide

(a) Your PROGRAM SOURCE CODE for Task 1.


(8)

(b) SCREEN CAPTURE(S) showing the test described in Task 2.


(1)
(Total 9 marks)

(a) State the most appropriate data type to use for numbers with a fractional part, for example
5. 12.79.

___________________________________________________________________

___________________________________________________________________
(1)

(b) State the identifier of a variable in the Skeleton Program that is used to hold a number
with a fractional part.

___________________________________________________________________

___________________________________________________________________
(1)
(Total 2 marks)

(a) State the most appropriate data type to use for values that may consist of more than one
6. character.

___________________________________________________________________

___________________________________________________________________
(1)

(b) State the identifier of a variable in the Skeleton Program that is used to hold more than
one character.

___________________________________________________________________

___________________________________________________________________
(1)
(Total 2 marks)

State the name of an identifier for a subroutine defined in the Skeleton Program that returns a
7. single digit number.

_______________________________________________________________________

_______________________________________________________________________
(Total 1 mark)

GEMS Metropole School Page 5 of 72


This question refers to the subroutine CalculateServingTime.
8.
Explain the reason for adding the value 1 to the result of dividing NoOfItems by TILL_SPEED.

_______________________________________________________________________

_______________________________________________________________________
(Total 1 mark)

This question refers to the subroutine QueueSimulator.


9.
Why might the subroutine Serving be called repeatedly after the specified time for the
simulation has finished?

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________
(Total 2 marks)

(a) Explain what is meant by composition and give an example where composition is used in
10. the Skeleton Program.

___________________________________________________________________

___________________________________________________________________

___________________________________________________________________

___________________________________________________________________
(2)

(b) Describe two reasons why composition is used in the Skeleton Program.

___________________________________________________________________

___________________________________________________________________

___________________________________________________________________

___________________________________________________________________
(2)
(Total 4 marks)

What is the named constant TIME_SERVING used for and what is the benefit of using a named
11. constant in this way?

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________
(Total 2 marks)

GEMS Metropole School Page 6 of 72


This question refers to the subroutine ServeBuyer.
12.
(a) Describe the purpose of the statements within the FOR loop.

___________________________________________________________________

___________________________________________________________________

___________________________________________________________________

___________________________________________________________________
(2)

(b) What aspect of a shop do the FOR loop and the statements inside it simulate?

___________________________________________________________________

___________________________________________________________________
(1)
(Total 3 marks)

One of the statistics calculated is average queue length.


13.
This is calculated using the data structure Stats.

(a) Describe how some of the values in Stats are used to calculate the average queue length
in the subroutine OutputStats.

___________________________________________________________________

___________________________________________________________________
(1)

(b) Describe how the relevant values in Stats are updated in the subroutine Serving to
enable the calculation in the subroutine OutputStats to produce the correct result.

___________________________________________________________________

___________________________________________________________________

___________________________________________________________________

___________________________________________________________________
(2)
(Total 3 marks)

In the Skeleton Program buyers join a single queue and are then served at one of several tills.
14.
Outline the design changes needed for buyers to form a separate queue for each till.

You are not expected to actually make the changes.

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________
(Total 2 marks)

GEMS Metropole School Page 7 of 72


This question extends the functionality of the Skeleton Program.
15.
When a buyer enters the shop and sees a long queue, they will change their mind and leave the
shop without buying anything. This is known as a shun.

The Skeleton Program is to be changed so that a buyer shunning the queue will cause the shop
to open another till, subject to the maximum number of tills available not being exceeded.

The subroutine BuyerArrives needs to be modified so that a buyer arriving when the queue
length is 5 will not join the queue. A running total of the number of buyers shunning the queue is
to be kept.

After a buyer has shunned the queue, the shop will open another till, until the maximum number
of tills available have opened.

At the end of the simulation the number of buyers that have shunned the queue should be output
as part of the statistics.

What you need to do:

Task 1
Create a constant value to use as an index for a previously unused element of the data structure
Stats in which to store the count of the number of shuns.

Task 2
Amend the subroutine BuyerArrives so that a buyer only joins the queue when fewer than 5
buyers are in the queue and shuns the queue if there are 5 buyers in the queue.

If a buyer shuns the queue, the number of shuns and the number of tills operating should be
updated as appropriate and a suitable message showing the ID of the buyer that has shunned
the queue should be displayed.

Task 3
Amend the subroutine OutputStats to output the total number of shuns with an appropriate
message.

Task 4
Test that the changes you have made work by conducting the following test:
• run your amended Skeleton Program
• enter Y
• enter 50
• enter 1

Evidence that you need to provide

(a) Your PROGRAM SOURCE CODE:


• that sets the value of the new constant
• for the entire subroutine BuyerArrives
• for the entire subroutine OutputStats.
(7)

(b) SCREEN CAPTURE(S) showing the requested test described in Task 4.

The SCREEN CAPTURE(S) only need to show the simulation statistics that are displayed
when the simulation finishes.
(1)
(Total 8 marks)

GEMS Metropole School Page 8 of 72


This question extends the functionality of the Skeleton Program, so that the length of time it
16. takes to serve a buyer depends on the speed of the till operator. The speed of the till operator is
the number of items they can handle in a time unit.

The simulation is to calculate the serving time for a buyer based upon the number of items in the
buyer’s basket and the speed of the till operator. The speed of each till operator needs to be
stored for each till.

What you need to do:

Task 1
An extra value is required for each element of Tills, representing the speed of the operator at a
till. Amend the declaration for Tills.

Task 2
Amend the subroutine ResetDataStructures so that the extra values are set so that till 0 has an
operator speed of 7 and till 1 has an operator speed of 6. Each subsequent till should have its
operator speed set to a value 1 less than the previous till.

Task 3
Amend the subroutine ChangeSettings so that it requires the user to set the till speed of each till
in use. The user should be given information about which till they are setting the current till
operator speed of and the current default value. ChangeSettings will require Tills as a
parameter and, depending on your language, as a return value, so the call to this subroutine will
also need amending.

Task 4
Amend the subroutine CalculateServingTime so that the serving time depends on the speed of
the till operator at the till that is being used.

Task 5
Test that the changes you have made work by conducting the following test:
• run your amended Skeleton Program
• enter Y
• enter 6
• enter 3
• enter 3
• enter 2
• enter 1

Evidence that you need to provide

(a) Your PROGRAM SOURCE CODE for the entire subroutine ResetDataStructures, the
entire subroutine ChangeSettings and the entire subroutine CalculateServingTime and
any code that you have changed or added to the Skeleton Program.
(8)

(b) SCREEN CAPTURE(S) showing the requested test described in Task 5.

The SCREEN CAPTURE(S) only need to show the entire output for time unit 5.
(1)
(Total 9 marks)

GEMS Metropole School Page 9 of 72


This question extends the functionality of the Skeleton Program.
17.
Till 0 is not currently used. It is to be used as the express till that buyers with fewer than 10 items
in their basket can use.

If till 0 is idle, the next buyer in the queue with fewer than 10 items in their basket comes out of
the queue and gets served at till 0.

What you need to do:

Task 1
Write a new subroutine ServeBuyerExpress that:
• finds the first buyer in the queue who has fewer than ten items in their basket and if there
is one:
◦ removes the buyer’s details from the queue
◦ closes the gap in the queue
◦ displays the buyer’s ID
◦ calls the UpdateStats subroutine for the express till
◦ calls the CalculateServingTime subroutine for the express till.

Task 2
Amend the subroutine Serving to check whether the express till is free and, if it is, call the
subroutine ServeBuyerExpress before checking the availability of other tills.

Task 3
Amend the subroutine OutputTillAndQueueStates to output the data for till 0 as well as the
data about the other tills which it already outputs.

Task 4
Test that the changes you have made work by conducting the following test:
• run your amended Skeleton Program
• enter N

Evidence that you need to provide

(a) Your PROGRAM SOURCE CODE for the entire subroutine ServeBuyerExpress, the entire
subroutine Serving and the entire subroutine OutputTillAndQueueStates.
(12)

(b) SCREEN CAPTURE(S) showing the requested test described in Task 4.

The SCREEN CAPTURE(S) only need to show the entire output for time unit 8.
(1)
(Total 13 marks)

Describe the set of real numbers.


18.
_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________
(Total 1 mark)

GEMS Metropole School Page 10 of 72


19. The number 5 can be written as

Shade two lozenges to indicate which of the following statements are true.

A 15 and 3 are not integers

B 15 and 3 are irrational numbers

C 5 is an irrational number

D 5 is a natural number

E 5 is a rational number

(Total 2 marks)

Shade one lozenge to indicate which of the symbols below represents the set of rational
20. numbers.

A ℂ

B ℕ

C ℚ

D ℝ

E ℤ

(Total 1 mark)

Convert the bit pattern 10001010 to hexadecimal.


21.
_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________
(Total 1 mark)

Represent the decimal number 139 as an 8-bit unsigned binary integer.


22.
_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________
(Total 1 mark)

GEMS Metropole School Page 11 of 72


Show how the unsigned binary number 00100011 can be added to the unsigned binary
23. number 00101011 without converting the numbers into decimal.

You must show all your working in binary.

(Total 2 marks)

Show how the 8-bit two’s complement binary integer 00011100 can be subtracted from the
24. 8-bit two’s complement binary integer 00111011 without converting the numbers to decimal.

You must show all your working in binary.

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________
(Total 2 marks)

The bit pattern in the figure below represents a 10-bit unsigned fixed point binary number with
25. four bits before and six bits after the binary point.

Convert the bit pattern in the figure above to decimal.

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________
(Total 2 marks)

State the name of the component on a sound card that transforms the continuous signal received
26. from a microphone to a form that can be stored by a computer.

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________
(Total 1 mark)

GEMS Metropole School Page 12 of 72


A bitmap image is 52 pixels in height and 26 pixels in width. The bitmap representation of the
27. image requires 845 bytes.

Calculate the maximum number of colours that could be used in the bitmap image.

You should show all your working.

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________
(Total 2 marks)

When a bitmap image is stored in a file, additional information is stored as well as the colours of
28. the pixels. For example, the bitmap file might contain information on the date of creation, image
width and height.

State the name given to this additional information when storing a bitmap image.

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________
(Total 1 mark)

A sound is recorded with a sample rate of 96 000 Hz and a sample resolution of 24 bits. The file
29. size of the recording is 12 096 kilobytes.

A sample rate of 1 Hz means that one sample has been taken every second.

Calculate the duration of the sound recording.

You should show all your working.

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________
(Total 3 marks)

GEMS Metropole School Page 13 of 72


A sample resolution of 16 bits is commonly used in audio recordings.
30.
Explain why increasing the sample resolution from 16 bits to 24 bits can improve the quality of an
audio recording.

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________
(Total 1 mark)

MIDI does not use sampling to represent music.


31.
Describe how music is represented using MIDI.

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________
(Total 2 marks)

Explain one advantage of using MIDI instead of sampled sound to represent music.
32.
_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________
(Total 1 mark)

A message is encrypted using a Caesar cipher that operates with a shift value of four. For
33. example, the letter A in plaintext would be represented by E in ciphertext.

The ciphertext for the message is WSSDI.

What is the plaintext for the message?

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________
(Total 1 mark)

Explain two reasons why Caesar ciphers are vulnerable to being cracked.
34.
_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________
(Total 2 marks)

GEMS Metropole School Page 14 of 72


Shade one lozenge to indicate which of the following is an example of system software.
35.

A Computer game

B Image editor

C Programming language translator

D Video conferencing software

E Word processor

(Total 1 mark)

An operating system manages hardware resources, for example the I/O devices associated with
36. a computer system.

State two other examples of hardware resources that an operating system is responsible for
managing.

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________
(Total 2 marks)

The figure shows the symbol for a logic gate.


37.

State the name of the logic gate shown in the figure above.

_______________________________________________________________________
(Total 1 mark)

GEMS Metropole School Page 15 of 72


The figure below shows a logic circuit.
38.

Complete the truth table for the logic circuit in the figure above.

A B C L M Z

0 0 0

0 0 1

0 1 0

0 1 1

1 0 0

1 0 1

1 1 0

1 1 1

(Total 2 marks)

The figure below shows a logic circuit.


39.

Write a Boolean expression for Q.

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________
(Total 3 marks)

GEMS Metropole School Page 16 of 72


Using the rules of Boolean algebra, simplify the following expression.
40.
⋅X⋅Z+W⋅Z+X⋅Y⋅ + ⋅X⋅Y⋅1

You must show your working.

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

Final answer ____________________


(Total 4 marks)

GEMS Metropole School Page 17 of 72


The figure below shows some of the processor registers and buses that are used during the fetch
41. stage of the fetch-execute cycle, together with the main memory.

State the name of the components that are labelled in the figure above with the numbers 1 to 4.
In the case of register names, the full names must be stated.

(Total 2 marks)

Describe the stored program concept.


42.
_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________
(Total 2 marks)

In a particular processor instruction set, each instruction consists of an opcode and an operand.
43. An operand could be an immediate value to be used by a program.

State two other types of value that can be stored in an operand.

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________
(Total 2 marks)

GEMS Metropole School Page 18 of 72


Computer A and Computer B both have a processor with a clock speed of 2.8 GHz but Computer
44. A performs tasks much faster than Computer B. Computer A has a larger cache and greater
word length than Computer B.

Explain why the larger cache and greater word length are possible factors for the performance
difference between Computer A and Computer B.

Larger cache ___________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

Greater word length ______________________________________________________

_______________________________________________________________________

_______________________________________________________________________
(Total 2 marks)

The table below shows the standard AQA assembly language instruction set that should be used
45. to answer this question

GEMS Metropole School Page 19 of 72


Standard AQA assembly language instruction set

LDR Rd, <memory ref> Load the value stored in the memory location
specified by <memory ref> into register d.

STR Rd, <memory ref> Store the value that is in register d into the
memory location specified by <memory ref>.

ADD Rd, Rn, <operand2> Add the value specified in <operand2> to the
value in register n and store the result in register
d.

SUB Rd, Rn, <operand2> Subtract the value specified by <operand2> from
the value in register n and store the result in
register d.

MOV Rd, <operand2> Copy the value specified by <operand2> into


register d.

CMP Rn, <operand2> Compare the value stored in register n with the
value specified by <operand2>.

B <label> Always branch to the instruction at position


<label> in the program.

B<condition> <label> Branch to the instruction at position <label> if


the last comparison met the criterion specified
by <condition>.
Possible values for <condition> and their
meanings are:
EQ: equal to
NE: not equal to
GT: greater than
LT: less than

AND Rd, Rn, <operand2> Perform a bitwise logical AND operation


between the value in register n and the value
specified by <operand2> and store the result in
register d.

ORR Rd, Rn, <operand2> Perform a bitwise logical OR operation between


the value in register n and the value specified by
<operand2> and store the result in register d.

EOR Rd, Rn, <operand2> Perform a bitwise logical XOR (exclusive or)
operation between the value in register n and
the value specified by <operand2> and store the
result in register d.

MVN Rd, <operand2> Perform a bitwise logical NOT operation on the


value specified by <operand2> and store the
result in register d.

LSL Rd, Rn, <operand2> Logically shift left the value stored in register n
by the number of bits specified by <operand2>
and store the result in register d.

LSR Rd, Rn, <operand2> Logically shift right the value stored in register n
by the number of bits specified by <operand2>

GEMS Metropole School Page 20 of 72


and store the result in register d.

HALT Stops the execution of the program.

Labels: A label is placed in the code by writing an identifier followed by a colon (:). To refer to a
label the identifier of the label is placed after the branch instruction.

Interpretation of <operand2>
<operand2> can be interpreted in two different ways, depending on whether the first character is
a # or an R:
1. # – use the decimal value specified after the #, eg #25 means use the decimal value 25
2. Rm – use the value stored in register m, eg R6 means use the value stored in register 6

The available general purpose registers that the programmer can use are numbered 0–12

Registers R1 and R3 each store a different positive number.

Write a program using the standard AQA assembly language in the table above that will:

• store the greater of these two numbers in R1


• store 1 in R2 if the value originally in R1 is greater than the value in R3, storing 3 in R2
otherwise.
(Total 4 marks)

RFID tags can be read by an RFID reader.


46.
Describe how data is read from an RFID tag.

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________
(Total 3 marks)

GEMS Metropole School Page 21 of 72


A smartphone company has designed a device that can be put into items such as luggage to
47. help locate these items if they are lost. The device works by sending an encrypted signal
containing its current location to nearby smartphones. The smartphones relay the signal to the
company’s servers via the Internet, allowing a user to see the device’s exact location using a
mobile phone app.

The company expects to sell hundreds of millions of devices. The data collected from each
device will be permanently kept in secondary storage on the company’s servers. The company is
planning to use solid-state drives in the servers that will hold device location data but is unsure
whether using solid-state drives is a good idea.

Discuss a range of moral, ethical, legal and cultural issues raised by the new device and explain
the properties of solid-state drives that the company should consider when deciding on a
secondary storage technology.

In your answer you will be assessed on your ability to follow a line of reasoning to produce a
coherent, relevant and structured response.

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________
(Total 12 marks)

GEMS Metropole School Page 22 of 72


Describe the difference between baud rate and bit rate.
48.
_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________
(Total 2 marks)

A photographer wants to create a large file sharing network to allow thousands of photographers
49. to share their photos with each other for free.

State two reasons why the photographer may choose to use a peer-to-peer network rather than
a client-server network.

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________
(Total 2 marks)

Explain the purpose of a Service Set Identifier (SSID).


50.
_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________
(Total 1 mark)

Explain how disabling SSID broadcasting can increase the security of a wireless network.
51.
_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________
(Total 2 marks)

GEMS Metropole School Page 23 of 72


Mark schemes
5 marks for AO2 (application)
1.

1 mark for each correct set of values in the correct sequence (boxed in red);

I. missing quotes
I. duplicated values in a column

If, after marking according to the boxed sections, fewer than 3 marks are awarded, 1 mark
can be awarded for each of the following, up to a maximum total of 3:

Column C completely correct;


Column R completely correct;
Columns J, X, D1, D2 and S all completely correct;

Max 4 if any errors


[5]

(a) 2 marks for AO1 (understanding)


2.
Global variables accessible to all parts of the program // local variables accessible only in
the program block/subroutine in which it was declared;
Local variables declared in subroutine // global variable declared in main program
block/outside subroutines;
Local variables only use memory/exist while the program block/subroutine (in which
they are declared) is executing;

Max 2
2

GEMS Metropole School Page 24 of 72


(b) 2 marks for AO1 (understanding)

Using local variables makes subroutine self-contained;


Using local variables aids modularisation;
Local variables use less memory // memory allocated to local variables can be
reused when subroutine not in use;
Variable names can be reused (in other parts of the program);
Code is easier to re-use in other programs;

A. Prevents unintended side-effects


A. Easier debugging/maintenance/testing

Max 2
2
[4]

3 marks for AO1 (understanding)


3.
Can get an overview of (the structure of) the program // code is easier to understand;
Can break problem down into sub-tasks;
Can re-use subroutines/modules; A. less duplication of code
Can distribute (implementation of) subroutines/modules among team;
Can test subroutines/modules independently // quicker/easier to debug/maintain // easier to
locate errors;

Max 3
[3]

(a) 8 marks for AO3 (programming)


4.
Mark as follows:
1. Correct variable declarations for Number1, Number2, Number, Count and initialisation;

Note to examiners:
If a language allows variables to be used without explicit declaration, (e.g. Python), then
this mark should be awarded if the correct variables exist in the program code and the first
value they are assigned is of the correct data type.

2. Correct prompts "Enter an integer: " and Number1 assigned integer value
entered by user and "Enter another integer: " and Number2 assigned integer
value entered by user;
3. Correct IF THEN ELSE statement syntax allowed by the programming language and
correct condition;
4. Correct assignments to Number in THEN and ELSE part;
5. Loop iterates correct number of times;
6. Correct condition to output X;
7. Correct condition to output V;
8. Correct output within loop without line feed;

I. case and minor typos

Max 7 if code does not function correctly

GEMS Metropole School Page 25 of 72


[Link]

Sub Main()
Dim Number1, Number2, Number, Count As Integer
[Link]("Enter an integer: ")
Number1 = [Link]() 'MP1
[Link]("Enter another integer: ")
Number2 = [Link]() 'MP2
If Number1 > Number2 Then 'MP3
Number = Number1 \ Number2
Else
Number = Number2 \ Number1 'MP4
End If
Count = 0
While Count <> Number 'MP5
Count = Count + 1
If (Count Mod 10) = 0 Then 'MP6
[Link]("X")
Else
If (Count Mod 5) = 0 Then 'MP7
[Link]("V")
Else
[Link]("/") 'MP8
End If
End If
End While
[Link]()
End Sub

Python 3

Number1 = int(input("Enter an integer: ")) # MP1


Number2 = int(input("Enter another integer: ")) # MP2
if Number1 > Number2: # MP3
Number = Number1 // Number2
else:
Number = Number2 // Number1 # MP4
Count = 0
while Count != Number: # MP5
Count += 1
if Count % 10 == 0: # MP6
print('X', end='')
elif Count % 5 == 0: # MP7
print('V', end='')
else:
print('/', end='') # MP8

Python 2

import sys
Number1 = int(raw_input("Enter an integer: ")) # MP1
Number2 = int(raw_input("Enter another integer: ")) # MP2
if Number1 > Number2: # MP3
Number = Number1 // Number2
else:
Number = Number2 // Number1 # MP4
Count = 0
while Count != Number: # MP5
Count += 1
if Count % 10 == 0: # MP6
[Link]('X')
elif Count % 5 == 0: # MP7
[Link]('V')
else:
[Link]('/') # MP8

GEMS Metropole School Page 26 of 72


Pascal

var
Number, Number1, Number2, Count: integer;
begin
write('Enter an integer: ');
readln(Number1); // MP1
write('Enter another integer: ');
readln(Number2); // MP2
if Number1 > Number2 then // MP3
Number := Number1 div Number2
else
Number := Number2 div Number1; // MP4
Count := 0;
while Count <> Number do // MP5
begin
inc(Count);
if Count mod 10 = 0 then // MP6
write('X')
else
if Count mod 5 = 0 then // MP7
write('V')
else
write('/'); // MP8
end;
readln;
end.

C#

[Link]("Enter an integer: ");


int Number1 = Convert.ToInt32([Link]()); // MP1
[Link]("Enter another integer: ");
int Number2 = Convert.ToInt32([Link]()); // MP2
int Number;
if (Number1 > Number2) // MP3
{
Number = Number1 / Number2;
}
else
{
Number = Number2 / Number1; // MP4
}
int Count = 0;
while (Count != Number) // MP5
{
Count++;
if (Count % 10 == 0) // MP6
{
[Link]("X");
}
else
{
if (Count % 5 == 0) // MP7
{
[Link]("V");
}
else
{
[Link]("/"); // MP8
}
}
}
[Link]();

GEMS Metropole School Page 27 of 72


Java

[Link]("Enter an integer: ");


int number1 = [Link]([Link]()); // MP1
[Link]("Enter another integer: ");
int number2 = [Link]([Link]());// MP2
int number;
if (number1 > number2) { // MP3
number = number1 / number2;
} else {
number = number2 / number1; // MP4
}
int count = 0;
while (count != number) { // MP5
count++;
if (count % 10 == 0) { // MP6
[Link]("X");
} else {
if (count % 5 == 0) { // MP7
[Link]("V");
} else {
[Link]("/"); // MP8
}
}
}
8

(b) Mark is for AO3 (evaluate)

**** SCREEN CAPTURE ****


Must match code from 04.1.
Code for 04.1 must be sensible.

Screen capture showing:

Enter an integer: 4
Enter another integer: 99
////V////X////V////X////
1
[9]

(a) Mark is for AO1 (knowledge)


5.
real/float/single/double/decimal;
1

(b) Mark is for AO2 (analyse)

AverageWaitingTime/AverageQLength;

R. if any additional code


R. if spelt incorrectly
I. case and spacing
1
[2]

(a) Mark is for AO1 (knowledge)


6.
String;

A. str
A. an array/list of characters
I. case
1

GEMS Metropole School Page 28 of 72


(b) Mark is for AO2 (analyse)

Answer / DataString / ThisBuyerID;

A. BLANK (Python only)


A. input, output, format (Java only)
A. BuyerID
R. [Link]
R. if any additional code
R. if spelt incorrectly
I. case and spacing

Max 1
1
[2]

Mark is for AO2 (analyse)


7.
FindFreeTill/ChangeSettings;

R. if any additional code


R. if spelt incorrectly
I. case and spacing
[1]

Mark is for AO2 (analyse)


8.
Otherwise there could be a serving time of 0;
Should round up to the (whole) number of time units needed;

A. by example such as:


if speed = 3, items = 8 then this will take more than 2 time units.

Max 1
[1]

2 marks for AO2 (analyse)


9.
To finish serving all (waiting) buyers // there might be buyers left who haven't been served;
... and include them in the statistics; A. example of any statistic listed in the simulation
statistics output.
[2]

GEMS Metropole School Page 29 of 72


(a) Procedural composition
10.
1 mark for AO1 (knowledge):

Combining subroutines to form compound subroutines // a subroutine that calls other


subroutines; A. another subroutine

1 mark for AO2 (analyse):

Several subroutines are combined to form the compound subroutine Serving //


FindFreeTill, ServeBuyer, UpdateStats, CalculateServingTime,
IncrementTimeWaiting, UpdateTills, OutputTillAndQueueStates are combined
into one subroutine Serving (Note: 2 or more subroutines must be named);

Several subroutines are combined to form the compound subroutine


QueueSimulator //
ResetDataStrucutures, ChangeSettings, ReadInSimulationData,
OutputHeading, BuyerArrives, Serving, TillsBusy,
OutputTillAndQueueStates, OutputStats, UpdateTills are combined into one
subroutine QueueSimulator (Note: 2 or more subroutines must be named);

Max 1

Data composition

1 mark for AO1 (knowledge):

Combining data objects to form compound data;

1 mark for AO2 (analyse):

Several records of type Q_Node are combined to form the compound data structure
BuyerQ // (three) values/data items are combined to make a Q_Node // BuyerID,
WaitingTime and ItemsInBasket are combined to make a Q_Node // arrays;
2

(b) 2 marks for AO2 (analyse)

Procedural composition

Some groups of subroutines need to be called in two places/more than one place //
the group of subroutines in Serving need to be called during the main simulation
time and also after buyers stop arriving;
Less code is required if only one compound subroutine needs to be called;
It improves understanding of code;

Data composition

Array elements are easier to address than individual variables;


The grouped data items/record can be manipulated as one unit;

Max 2

Award marks for either procedural composition or data composition or both.


2
[4]

2 marks for AO2 (analyse)


11.
As index into (elements of) the Tills data structure // to specify which array element
should be used;
Don't need to remember which element of the data structure is used when referring to it //
code is easier to understand // the data structure can be changed / reordered and just by
changing this value the program will still work;
[2]

GEMS Metropole School Page 30 of 72


(a) 2 marks for AO2 (analyse)
12.
All queue records (apart from the first one);
are moved one location (forward);
2

(b) Mark is for AO2 (analyse)

Buyers moving forward in/towards the front of/up the queue;


1
[3]

(a) Mark is for AO2 (analyse)


13.
Divides Stats[TOTAL_Q] by Stats[TOTAL_Q_OCCURENCE];
1

(b) 2 marks for AO2 (analyse)

Stats[TOTAL_Q] has the length of the queue added onto it (in each time unit that
there is a non-empty queue);
Stats[TOTAL_Q_OCCURRENCE] is incremented in each time unit that there is a
(non-empty) queue;

DPT within 14.2 reference to an index such as TOTAL_Q rather than the data to which
it points, such as Stats[TOTAL_Q]
2
[3]

2 marks for AO3 (design)


14.
Need a 2D data structure/list of lists to store the queues // add a field to Q_Node to store
which till the buyer is queuing for // add a queue/array/list to each Till/element of the
Tills data structure;

R. Use one array per Till

Need code to allocate buyers to different queues // the code that moves someone out of
the queue to be served would need changing // the code that moves everyone in the queue
up would need changing // the code that displays the contents of the queue would need
changing;
[2]

(a) 7 marks for AO3 (programming)


15.
Marking guidance:

Evidence of AO3 programming - 7 marks:

Evidence of programming to look for in response:

1. Constant declared and used as index (any index between 6 and 9) for
Stats;
2. If queue length not less than 5 ... // if queue length equals 5 ...;
3. ... Increment count of shuns in Stats data structure; R. if not within a
selection structure.
4. ... Output buyer number and message; R. if not within a selection structure.
5. ... If number of tills is less than MAX_TILLS ...; R. if not within a selection
structure.
6. .... Increment NoOfTills; R. if not within a nested selection structure.
7. In OutputStats output number of total shuns with suitable message;

Max 6 if any errors

GEMS Metropole School Page 31 of 72


[Link]

' indices for Stats data structure


Const MAX_Q_LENGTH As Integer = 0
Const MAX_WAIT As Integer = 1
Const TOTAL_WAIT As Integer = 2
Const TOTAL_Q As Integer = 3
Const TOTAL_Q_OCCURRENCE As Integer = 4
Const TOTAL_NO_WAIT As Integer = 5
Const TOTAL_SHUNS As Integer = 6 'Q16 MP1

Sub BuyerArrives(Data(,) As Integer, BuyerQ() As Q_Node, ByRef QLength


As Integer, BuyerNumber As Integer, ByRef NoOfTills As Integer, Stats()
As Integer)
If QLength < 5 Then 'Q16 MP2
[Link]($" B{BuyerNumber}({Data(BuyerNumber, ITEMS)})")
BuyerJoinsQ(Data, BuyerQ, QLength, BuyerNumber)
Else
Stats(TOTAL_SHUNS) += 1 'Q16 MP3
If NoOfTills < MAX_TILLS Then 'Q16 MP5
NoOfTills += 1 'Q16 MP6
End If
[Link]($" B{BuyerNumber} has shunned the queue.") 'Q16
MP4
End If
End Sub

Sub OutputStats(Stats() As Integer, BuyerNumber As Integer,


SimulationTime As Integer)
[Link]("The simulation statistics are:")
[Link]("==============================")
[Link]($"The maximum queue length was:
{Stats(MAX_Q_LENGTH)} buyers")
[Link]($"The maximum waiting time was: {Stats(MAX_WAIT)}
time units")
[Link]($"{BuyerNumber} buyers arrived during
{SimulationTime} time units")
[Link]($"The average waiting time was:
{[Link](Stats(TOTAL_WAIT) / BuyerNumber, 1)} time units")
If Stats(TOTAL_Q_OCCURRENCE) > 0 Then
[Link]($"The average queue length was:
{[Link](Stats(TOTAL_Q) / Stats(TOTAL_Q_OCCURRENCE), 2)} buyers")
End If
[Link]($"{Stats(TOTAL_NO_WAIT)} buyers did not need to
queue")
[Link]($"{Stats(TOTAL_SHUNS)} buyers shunned the queue")
'Q16 MP7
End Sub

GEMS Metropole School Page 32 of 72


Python 3

# indices for Stats data structure


MAX_Q_LENGTH = 0
MAX_WAIT = 1
TOTAL_WAIT = 2
TOTAL_Q = 3
TOTAL_Q_OCCURENCE = 4
TOTAL_NO_WAIT = 5
TOTAL_SHUNS = 6 # Q16 MP1

def BuyerArrives(Data, BuyerQ, QLength, BuyerNumber, NoOfTills, Stats):


if QLength < 5:# Q16 MP2
print(f" B{BuyerNumber}({Data[BuyerNumber][ITEMS]})")
BuyerQ, QLength = BuyerJoinsQ(Data, BuyerQ, QLength, BuyerNumber)
else:
Stats[TOTAL_SHUNS] += 1 # Q16 MP3
print(f"Buyer {BuyerNumber} shunned the queue") # Q16 MP4
if NoOfTills < MAX_TILLS: # Q16 MP5
NoOfTills += 1 # Q16 MP6
return BuyerQ, QLength, NoOfTills, Stats

def OutputStats(Stats, BuyerNumber, SimulationTime):


print("The simulation statistics are:")
print("==============================")
print(f"The maximum queue length was: {Stats[MAX_Q_LENGTH]} buyers")
print(f"The maximum waiting time was: {Stats[MAX_WAIT]} time units")
print(f"{BuyerNumber} buyers arrived during {SimulationTime} time
units")
AverageWaitingTime = round(Stats[TOTAL_WAIT] / BuyerNumber, 1)
print(f"The average waiting time was: {AverageWaitingTime} time units")
if Stats[TOTAL_Q_OCCURRENCE] > 0:
AverageQLength = round(Stats[TOTAL_Q] / Stats[TOTAL_Q_OCCURRENCE], 2)
print(f"The average queue length was: {AverageQLength} buyers")
print(f"{Stats[TOTAL_NO_WAIT]} buyers did not need to queue")
print(f"{Stats[TOTAL_SHUNS]} buyers turned away because the queue was
too long") # Q16 MP7

GEMS Metropole School Page 33 of 72


Python 2

# indices for Stats data structure


MAX_Q_LENGTH = 0
MAX_WAIT = 1
TOTAL_WAIT = 2
TOTAL_Q = 3
TOTAL_Q_OCCURRENCE = 4
TOTAL_NO_WAIT = 5
TOTAL_SHUNS = 6 # Q16 MP1

def BuyerArrives(Data, BuyerQ, QLength, BuyerNumber, NoOfTills, Stats):


if QLength < 5:# Q16 MP2
[Link](' B{0}({1})'.format(BuyerNumber, Data[BuyerNumber]
[ITEMS]))
print
BuyerQ, QLength = BuyerJoinsQ(Data, BuyerQ, QLength, BuyerNumber)
else:
Stats[TOTAL_SHUNS] += 1 # Q16 MP3
print "Buyer ", BuyerNumber, " shunned the queue" # Q16 MP4
if NoOfTills < MAX_TILLS: # Q16 MP5
NoOfTills += 1 # Q16 MP6
return BuyerQ, QLength, NoOfTills, Stats

def OutputStats(Stats, BuyerNumber, SimulationTime):


print "The simulation statistics are:"
print "==============================="
print "The maximum queue length was: ", Stats[MAX_Q_LENGTH], " buyers"
print "The maximum waiting time was: ", Stats[MAX_WAIT], " time units"
print BuyerNumber, " buyers arrived during ", SimulationTime, " time
units"
print "The average waiting time was:", round(Stats[TOTAL_WAIT]*1.0/
BuyerNumber, 1), "time units"
if Stats[TOTAL_Q_OCCURRENCE] > 0:
print "The average queue length was:", round(Stats[TOTAL_Q]*1.0 /
Stats[TOTAL_Q_OCCURRENCE], 2), "buyers"
print Stats[TOTAL_NO_WAIT], " buyers did not need to queue"
print Stats[TOTAL_SHUNS], " buyers turned away because the queue was
too long" # Q16 MP7

GEMS Metropole School Page 34 of 72


Pascal

// indices for Stats data structure


MAX_Q_LENGTH = 0;
MAX_WAIT = 1;
TOTAL_WAIT = 2;
TOTAL_Q = 3;
TOTAL_Q_OCCURRENCE = 4;
TOTAL_NO_WAIT = 5;
TOTAL_SHUNS = 6; // Q16 MP1

procedure BuyerArrives(var Data: TData; var BuyerQ:TBuyerQ; var


QLength: integer; BuyerNumber: integer; var NoOfTills: integer; var
Stats: TStats);
begin
if QLength < 5 then // Q16 MP2
begin
writeln(' B ', BuyerNumber, '(', Data[BuyerNumber, ITEMS], ')');
BuyerJoinsQ(Data, BuyerQ, QLength, BuyerNumber);
end
else
begin
inc(Stats[TOTAL_SHUNS]); // Q16 MP3
writeln('Buyer', BuyerNumber, ' shunned the queue'); // Q16 MP4
if NoOfTills < MAX_TILLS then // Q16 MP5
inc(NoOfTills); // Q16 MP6
end;
end;

procedure OutputStats(var Stats: TStats; BuyerNumber: integer;


SimulationTime: integer);
var
AverageWaitingTime, AverageQLength: real;
begin
writeln('The simulation statistics are:');
writeln('==============================');
writeln('The maximum queue length was: ', Stats[MAX_Q_LENGTH], '
buyers');
writeln('The maximum waiting time was: ', Stats[MAX_WAIT], ' time
units');
writeln(BuyerNumber, ' buyers arrived during ', SimulationTime, ' time
units');
AverageWaitingTime := Stats[TOTAL_WAIT] / BuyerNumber;
writeln('The average waiting time was: ', AverageWaitingTim[Link], '
time units');
if Stats[TOTAL_Q_OCCURRENCE] > 0 then
begin
AverageQLength := Stats[TOTAL_Q] / Stats[TOTAL_Q_OCCURRENCE];
writeln('The average queue length was: ', AverageQLength:2:2, '
buyers');
end;
writeln(Stats[TOTAL_NO_WAIT], ' buyers did not need to queue');
writeln (Stats[TOTAL_SHUNS], ' buyers turned away because the queue was
too long'); // Q16 MP7
end;

GEMS Metropole School Page 35 of 72


C#

// indices for Stats data structure


const int MAX_Q_LENGTH = 0;
const int MAX_WAIT = 1;
const int TOTAL_WAIT = 2;
const int TOTAL_Q = 3;
const int TOTAL_Q_OCCURRENCE = 4;
const int TOTAL_NO_WAIT = 5;
const int TOTAL_SHUNS = 6; // Q16 MP1

public static void BuyerArrives(int[,] Data, Q_Node[] BuyerQ, ref int


QLength, int BuyerNumber, ref int NoOfTills, int[] Stats)
{
if (QLength < 5) // Q16 MP2
{
[Link]($" B{BuyerNumber}({Data[BuyerNumber, ITEMS]})");
BuyerJoinsQ(Data, BuyerQ, ref QLength, BuyerNumber);
}
else
{
Stats[TOTAL_SHUNS]++; // Q16 MP3
[Link]($" B{BuyerNumber} has shunned the queue."); //Q16
MP4
if (NoOfTills < MAX_TILLS) // Q16 MP5
{
NoOfTills++; // Q16 MP6
}
}
}

public static void OutputStats(int[] Stats, int BuyerNumber, int


SimulationTime)
{
double AverageWaitingTime, AverageQLength;
[Link]("The simulation statistics are:");
[Link]("==============================");
[Link]($"The maximum queue length was:
{Stats[MAX_Q_LENGTH]} buyers");
[Link]($"The maximum waiting time was: {Stats[MAX_WAIT]}
time units");
[Link]($"{BuyerNumber} buyers arrived during
{SimulationTime} time units");
AverageWaitingTime = [Link]((double)Stats[TOTAL_WAIT] /
BuyerNumber, 1);
[Link]($"The average waiting time was:
{AverageWaitingTime} time units");
if (Stats[TOTAL_Q_OCCURRENCE] > 0)
{
AverageQLength = [Link]((double)Stats[TOTAL_Q] /
Stats[TOTAL_Q_OCCURRENCE], 2);
[Link]($"The average queue length was: {AverageQLength}
buyers");
}
[Link]($"{Stats[TOTAL_NO_WAIT]} buyers did not need to
queue");
[Link]($"{Stats[TOTAL_SHUNS]} buyers shunned the queue");
//Q16 MP7
}

GEMS Metropole School Page 36 of 72


Java

// indices for Stats data structure


final int MAX_Q_LENGTH = 0;
final int MAX_WAIT = 1;
final int TOTAL_WAIT = 2;
final int TOTAL_Q = 3;
final int TOTAL_Q_OCCURRENCE = 4;
final int TOTAL_NO_WAIT = 5;
final int TOTAL_SHUN = 6; // Q16 MP1

int[] buyerArrives(int[][] data, Q_Node[] buyerQ, int qLength, int


buyerNumber, int noOfTills, int[] stats) {
if (qLength < 5) { // QP16 MP2
[Link]([Link](" B%d(%d)", buyerNumber,
data[buyerNumber][ITEMS]));
qLength = buyerJoinsQ(data, buyerQ, qLength, buyerNumber);
} else {
if (noOfTills < MAX_TILLS) { // QP16 MP5
noOfTills++; // QP16 MP6
}
stats[TOTAL_SHUN]++; // Q16 MP3
[Link]([Link](" B%d shuns the queue",
buyerNumber)); // QP16 MP4
}
return new int[] { qLength, noOfTills };
}

void outputstats(int[] stats, int buyerNumber, int simulationTime) {


[Link]("The simulation statistics are:");
[Link]("===============================");
[Link]([Link]("The maximum queue length was: %d
buyers", stats[MAX_Q_LENGTH]));
[Link]([Link]("The maximum waiting time was: %d time
units", stats[MAX_WAIT]));
[Link]([Link]("%d buyers arrived during %d time
units", buyerNumber, simulationTime));
double averagewaitingTime =
(double)[Link]((double)stats[TOTAL_WAIT] / buyerNumber *10)/10;
[Link]([Link]("The average waiting time was: %.1f
time units", averagewaitingTime));
if (stats[TOTAL_Q_OCCURRENCE] > 0) {
double averageqLength = (double)[Link]((double)stats[TOTAL_Q] /
stats[TOTAL_Q_OCCURRENCE] * 100)/100;
[Link]([Link]("The average queue length was: %.2f
buyers", averageqLength));
}
[Link]([Link]("%d buyers did not need to queue",
stats[TOTAL_NO_WAIT]));
[Link]([Link]("%d buyers shunned the queue",
stats[TOTAL_SHUN])); // QP16 MP7
}
7

GEMS Metropole School Page 37 of 72


(b) Mark is for AO3 (evaluate)

**** SCREEN CAPTURE ****


Must match code from (a), including prompts on screen capture matching those in
code.
Code for (a) must be sensible.

Screen capture showing:

The simulation statistics are:


==============================
The maximum queue length was: 5 buyers
The maximum waiting time was: 12 time units
33 buyers arrived during 50 time units
The average waiting time was: 4.2 time units
The average queue length was: 3.26 buyers
4 buyers did not need to queue
4 buyers turned away because the queue was too long
1
[8]

(a) 2 marks for AO3 (design) and 6 marks for AO3 (programming)
16.
Marking guidance:

Evidence of AO3 design - 2 marks:

Evidence of design to look for in response:

1. Identify the need for a loop or equivalent to initialise the till speeds/re-use
loop in ResetDataStructures;
2. Recognise need to use Tills data structure to calculate serving time in
CalculateServingTime;

Note: AO3 (design) points are for selecting appropriate techniques to use to solve
the problem, so should be credited whether the syntax of programming language
statements is correct or not and regardless of whether the solution works.

Evidence of AO3 programming - 6 marks:

Evidence of programming to look for in response:

3. Correctly calculate and store the default till speeds;


4. Correctly change the size of each element in Tills;
5. Add Tills to parameter list of ChangeSettings definition and call // add
Tills to return value (Python) and assign in call to ChangeSettings in
QueueSimulator;
6. Correctly set up loop to set the speed for each till;
7. Output suitable message to user including till number and default till speed;
8. Store till speed entered by user in correct element of Tills;

Max 7 if any errors

GEMS Metropole School Page 38 of 72


[Link]

Sub ResetDataStructures(Stats() As Integer, Tills(,) As Integer,


BuyerQ() As Q_Node)
For i As Integer = 0 To 9
Stats(i) = 0
Next
For Count As Integer = 0 To MAX_TILLS
For i As Integer = 0 To 2
Tills(Count, i) = 0
Next
Tills(Count, 3) = 7 - Count ' Q17 MP1 MP3
Next
For i As Integer = 0 To MAX_Q_SIZE - 1
BuyerQ(i).BuyerID = BLANK
BuyerQ(i).WaitingTime = 0
BuyerQ(i).ItemsInBasket = 0
Next
End Sub

Sub ChangeSettings(ByRef SimulationTime As Integer, ByRef NoOfTills As


Integer, Tills(,) As Integer) 'Q17 MP5 part
SimulationTime = 10
NoOfTills = 2
[Link]("Settings set for this simulation:")
[Link]("=================================")
[Link]($"Simulation time: {SimulationTime}")
[Link]($"Tills operating: {NoOfTills}")
[Link]("=================================")
[Link]()
[Link]("Do you wish to change the settings? Y/N: ")
Dim Answer As String = [Link]()
If Answer = "Y" Then
[Link]($"Maximum simulation time is {MAX_TIME} time
units")
[Link]("Simulation run time: ")
SimulationTime = Convert.ToInt32([Link]())
While SimulationTime > MAX_TIME Or SimulationTime < 1
[Link]($"Maximum simulation time is {MAX_TIME} time
units")
[Link]("Simulation run time: ")
SimulationTime = Convert.ToInt32([Link]())
End While
[Link]($"Maximum number of tills is {MAX_TILLS}")
[Link]("Number of tills in use: ")
NoOfTills = Convert.ToInt32([Link]())
While NoOfTills > MAX_TILLS Or NoOfTills < 1
[Link]($"Maximum number of tills is {MAX_TILLS}")
[Link]("Number of tills in use: ")
NoOfTills = Convert.ToInt32([Link]())
End While
For count = 1 To NoOfTills ' Q17 MP6
[Link]($"Enter operator speed for till {count}.")
[Link]($"Default value is {Tills(count, 3)}:") ' Q17 MP7
Tills(count, 3) = [Link]() ' Q17 MP8
Next
End If
End Sub

Sub CalculateServingTime(Tills(,) As Integer, ThisTill As Integer,


NoOfItems As Integer)
Dim ServingTime As Integer = (NoOfItems \ Tills(ThisTill, 3)) + 1 '
Q17 MP2
Tills(ThisTill, TIME_SERVING) = ServingTime
[Link]($"{ThisTill,6}{ServingTime,6}")
End Sub

Sub QueueSimulator()
Dim BuyerNumber As Integer = 0
Dim QLength As Integer = 0
Dim Stats(9) As Integer
Dim Tills(MAX_TILLS, 3) As Integer ' Q17 MP4

GEMS Metropole School Page 39 of 72


Dim Data(MAX_TIME, 1) As Integer
Dim BuyerQ(MAX_Q_SIZE - 1) As Q_Node
Dim SimulationTime, NoOfTills, TimeToNextArrival, ExtraTime, TimeUnit
As Integer
ResetDataStructures(Stats, Tills, BuyerQ)
ChangeSettings(SimulationTime, NoOfTills, Tills) ' MP5 part
............

Python 3

def ResetDataStructures():
Stats = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
Tills = [[0, 0, 0, 0] for i in range(MAX_TILLS + 1)] # Q17 MP4
for Count in range(MAX_TILLS + 1): # Q17 MP1
Tills[Count][3] = 7 - Count # Q17 MP3
BuyerQ = [Q_Node() for i in range(MAX_Q_SIZE)]
return Stats, Tills, BuyerQ

def ChangeSettings(Tills): # Q17 MP5 part


SimulationTime = 10
NoOfTills = 2
print("Settings set for this simulation:")
print("=================================")
print(f"Simulation time: {SimulationTime}")
print(f"Tills operating: {NoOfTills}")
print("=================================")
print()
Answer = input("Do you wish to change the settings? Y/N: ")
if Answer == 'Y':
print(f"Maximum simulation time is {MAX_TIME} time units")
SimulationTime = int(input("Simulation run time: "))
while SimulationTime > MAX_TIME:
print(f"Maximum simulation time is {MAX_TIME} time units")
SimulationTime = int(input("Simulation run time: "))
print(f"Maximum number of tills is {MAX_TILLS}")
NoOfTills = int(input("Number of tills in use: "))
while NoOfTills > MAX_TILLS:
print(f"Maximum number of tills is {MAX_TILLS}")
NoOfTills = int(input("Number of tills in use: "))
for Count in range(1, NoOfTills + 1): # Q17 MP6
Tills[Count][3] = int(input(f"Enter the till speed (items processed
per time unit (default {Tills[Count][3]}) for till {Count}): ")) # Q17
MP7 MP8
return Tills, SimulationTime, NoOfTills

def CalculateServingTime(Tills, ThisTill, NoOfItems):


ServingTime = (NoOfItems // Tills[ThisTill][3]) + 1 # Q17 MP2
Tills[ThisTill][TIME_SERVING] = ServingTime
print(f"{ThisTill:>6d}{ServingTime:>6d}")
return Tills

def QueueSimulator():
BuyerNumber = 0
QLength = 0
Stats, Tills, BuyerQ = ResetDataStructures()
Tills, SimulationTime, NoOfTills = ChangeSettings(Tills) # Q17 MP5 part

A. TILL_SPEED instead of 3 as index

Alternative answer
def ResetDataStructures():
Stats = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
Tills = [[0, 0, 0, 7 - i] for i in range(MAX_TILLS + 1)] # Q17 MP1 MP4
# Q17 MP3
BuyerQ = [Q_Node() for i in range(MAX_Q_SIZE)]
return Stats, Tills, BuyerQ

GEMS Metropole School Page 40 of 72


Python 2

def ResetDataStructures():
Stats = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
Tills = [[0, 0, 0, 0] for i in range(MAX_TILLS + 1)] # Q17 MP4
for Count in range(MAX_TILLS + 1): # Q17 MP1
Tills[Count][3] = 7 - Count # Q17 MP3
BuyerQ = [Q_Node() for i in range(MAX_Q_SIZE)]
return Stats, Tills, BuyerQ

def ChangeSettings(Tills): # Q17 MP5 part


SimulationTime = 10
NoOfTills = 2
print "Settings set for this simulation:"
print "================================="
print "Simulation time: ", SimulationTime
print "Tills operating: ", NoOfTills
print "================================="
print
Answer = raw_input("Do you wish to change the settings? Y/N: ")
if Answer == 'Y':
print "Maximum simulation time is ", MAX_TIME, " time units"
SimulationTime = int(raw_input("Simulation run time: "))
while SimulationTime > MAX_TIME or SimulationTime < 1:
print "Maximum simulation time is ", MAX_TIME, " time units"
SimulationTime = int(raw_input("Simulation run time: "))
print "Maximum number of tills is ", MAX_TILLS
NoOfTills = int(raw_input("Number of tills in use: "))
while NoOfTills > MAX_TILLS or NoOfTills < 1:
print "Maximum number of tills is ", MAX_TILLS
NoOfTills = int(raw_input("Number of tills in use: "))
for Count in range(1, NoOfTills + 1): # Q17 MP6
[Link]('Enter the till speed (items processed per time
unit (default {0}) for till {1}: '.format(Tills[Count][3], Count)) # Q17
MP7
Tills[Count][3] = int(raw_input()) # Q17 MP8
return Tills, SimulationTime, NoOfTills

def CalculateServingTime(Tills, ThisTill, NoOfItems):


ServingTime = (NoOfItems // Tills[ThisTill][3]) + 1 # Q17 MP2
Tills[ThisTill][TIME_SERVING] = ServingTime
[Link]('{0:>6}{1:>6}'.format(ThisTill, ServingTime))
print
return Tills

def QueueSimulator():
BuyerNumber = 0
QLength = 0
Stats, Tills, BuyerQ = ResetDataStructures()
Tills, SimulationTime, NoOfTills = ChangeSettings(Tills) # Q17 MP5 part

GEMS Metropole School Page 41 of 72


Pascal

procedure ResetDataStructures(var Stats: TStats; var Tills: TTills; var


BuyerQ: TBuyerQ);
var
Count, i: integer;
begin
for i := 0 to 9 do
begin
Stats[i] := 0;
end;
for Count := 0 to MAX_TILLS do
begin
for i := 0 to 2 do
begin
Tills[Countl, i] := 0;
end;
Tills[Count, 3] := 7 - Count; // Q17 MP1, MP3, MP4
end;
for i := 0 to MAX_Q_SIZE - 1 do
begin
BuyerQ[i].BuyerID := BLANK;
BuyerQ[i].WaitingTime := 0;
BuyerQ[i].ItemsInBasket := 0;
end;
end;

procedure ChangeSettings(var SimulationTime: integer; var NoOfTills:


integer; var Tills: TTills); // Q17 MP5 part
var Answer: char;
Count: integer;
begin
SimulationTime := 10;
NoOfTills := 2;
writeln('Settings set for this simulation:');
writeln('=================================');
writeln('Simulation time: ', SimulationTime);
writeln('Tills operating: ', NoOfTills);
writeln('=================================');
writeln;
write('Do you wish to change the settings? Y/N: ');
readln(Answer);
if Answer = 'Y' then
begin
writeln('Maximum simulation time is ', MAX_TIME, ' time units');
write('Simulation run time: ');
readln(SimulationTime);
while (SimulationTime > MAX_TIME) or (SimulationTime < 1) do
begin
writeln('Maximum simulation time is ', MAX_TIME, ' time
units');
write('Simulation run time: ');
readln(SimulationTime);
end;
writeln('Maximum number of tills is ', MAX_TILLS);
write('Number of tills in use: ');
readln(NoOfTills);
while (NoOfTills > MAX_TILLS) or (NoOfTills < 1) do
begin
writeln('Maximum number of tills is ', MAX_TILLS);
write('Number of tills in use: ');
readln(NoOfTills);
end;
for Count := 1 to NoOfTills do // Q17 MP6
begin
write('Enter the till speed (items processed per time unit
(default ', Tills[Count, 3], ')) for till ', Count, ': '); // Q17 MP7
readln(Tills[Count, 3]); // Q17 MP8
end;
end;
end;

GEMS Metropole School Page 42 of 72


procedure CalculateServingTime(var Tills: TTills; ThisTill: integer;
NoOfItems: integer);
var
ServingTime: integer;
begin
ServingTime := (NoOfItems DIV Tills[ThisTill, 3]) + 1; // Q17 MP2
Tills[ThisTill][TIME_SERVING] := ServingTime;
writeln(ThisTill:6, ServingTime:6);
end;

type
Q_Node = record
BuyerID: string;
WaitingTime: integer;
ItemsInBasket: integer;
end;
TStats = array[0 .. 9] of integer;
TTills = array[0 .. MAX_TILLS, 0 .. 3] of integer; // Q17 MP4
TBuyerQ = array[0 .. MAX_Q_SIZE - 1] of Q_Node;
TData = array[0 .. MAX_TIME, 0 .. 1] of integer

procedure QueueSimulator();
var
BuyerNumber, QLength, SimulationTime, NoOfTills, TimeToNextArrival,
TimeUnit, ExtraTime: integer;
Stats: TStats;
Tills: TTills;
BuyerQ: TBuyerQ;
Data: TData;
begin
BuyerNumber := 0;
QLength := 0;
ResetDataStructures(Stats, Tills, BuyerQ);
ChangeSettings(SimulationTime, NoOfTills, Tills); // Q17 MP5 part

GEMS Metropole School Page 43 of 72


C#

public static void ResetDataStructures(int[] Stats, int[,] Tills,


Q_Node[] BuyerQ)
{
for (int i = 0; i <= 9; i++)
{
Stats[i] = 0;
}
for (int Count = 0; Count <= MAX_TILLS; Count++)
{
for (int i= 0; i <= 2; i++)
{
Tills[Count, i] = 0;
}
Tills[Count, 3] = 7 - Count; // Q17 MP1, MP3, MP4
}
for (int i = 0; i < MAX_Q_SIZE; i++)
{
BuyerQ[i].BuyerID = BLANK;
BuyerQ[i].WaitingTime = 0;
BuyerQ[i].ItemsInBasket = 0;
}
}

public static void ChangeSettings(ref int SimulationTime, ref int


NoOfTills, int[,] Tills) // Q17 MP5 part
{
SimulationTime = 10;
NoOfTills = 2;
[Link]("Settings set for this simulation:");
[Link]("=================================");
[Link]($"Simulation time: {SimulationTime}");
[Link]($"Tills operating: {NoOfTills}");
[Link]("=================================");
[Link]();
[Link]("Do you wish to change the settings? Y/N: ");
string Answer = [Link]();
if (Answer == "Y")
{
[Link]($"Maximum simulation time is {MAX_TIME} time
units");
[Link]("Simulation run time: ");
SimulationTime = Convert.ToInt32([Link]());
while (SimulationTime > MAX_TIME || SimulationTime < 1)
{
[Link]($"Maximum simulation time is {MAX_TIME} time
units");
[Link]("Simulation run time: ");
SimulationTime = Convert.ToInt32([Link]());
}
[Link]($"Maximum number of tills is {MAX_TILLS}");
[Link]("Number of tills in use: ");
NoOfTills = Convert.ToInt32([Link]());
while (NoOfTills > MAX_TILLS || NoOfTills < 1)
{
[Link]($"Maximum number of tills is {MAX_TILLS}");
[Link]("Number of tills in use: ");
NoOfTills = Convert.ToInt32([Link]());
}
for (int count = 1; count <= NoOfTills; count++) // Q17 MP6
{
[Link]($"Enter operator speed for till {count}.");
[Link]($"Default value is {Tills[count, 3]} :"); // Q17
MP7
Tills[count, 3] = Convert.ToInt32([Link]()); // Q17 MP8
}
}
}

public static void CalculateServingTime(int[,] Tills, int ThisTill, int


NoOfItems)

GEMS Metropole School Page 44 of 72


{
int ServingTime = (NoOfItems / Tills[ThisTill, 3]) + 1; // Q17 MP2
Tills[ThisTill, TIME_SERVING] = ServingTime;
[Link]($"{ThisTill,6}{ServingTime,6}");
}

public static void QueueSimulator()


{
int BuyerNumber = 0;
int QLength = 0;
int[] Stats = new int[10];
int[,] Tills = new int[MAX_TILLS + 1, 4]; // Q17 MP4;
int[,] Data = new int[MAX_TIME + 1, 2];
Q_Node[] BuyerQ = new Q_Node[MAX_Q_SIZE];
int SimulationTime = 0;
int NoOfTills = 0;
int TimeToNextArrival;
int ExtraTime;
int TimeUnit;
ResetDataStructures(Stats, Tills, BuyerQ);
ChangeSettings(ref SimulationTime, ref NoOfTills, Tills); // Q17 MP5
part

GEMS Metropole School Page 45 of 72


Java

public void resetDataStructures(int[] stats, int[][] tills, Q_Node[]


buyerQ) {
for (int i = 0; i <=9; i++) {
stats[i] = 0;
}
for (int count = 0; count <= MAX_TILLS; count++) {
for (int i = 0; i <= 2; i++) {
tills[count][i] = 0;
}
tills[count][3] = 7 - count; // Q17 MP1 MP3
}
for (int i = 0; i < MAX_Q_SIZE; i++) {
buyerQ[i] = new Q_Node();
}
}

int[] changeSettings(int[][] tills) { // Q17 MP5 part


int simulationTime = 10;
int noOfTills = 2;
[Link]("Settings set for this simulation:");
[Link]("=================================");
[Link]([Link]("Simulation time: %d",
simulationTime));
[Link]([Link]("Tills operating: %d", noOfTills));
[Link]("=================================");
[Link]();
[Link]("Do you wish to change the settings? Y/N: ");
String answer = [Link]();
if ([Link]("Y")) {
[Link]([Link]("Maximum simulation time is %d time
units", MAX_TIME));
[Link]("Simulation run time: ");
simulationTime = [Link]([Link]());
while (simulationTime > MAX_TIME || simulationTime < 1) {
[Link]([Link]("Maximum simulation time is %d time
units", MAX_TIME));
[Link]("Simulation run time: ");
simulationTime = [Link]([Link]());
}
[Link]([Link]("Maximum number of tills is %d",
MAX_TILLS));
[Link]("Number of tills in use: ");
noOfTills = [Link]([Link]());
while (noOfTills > MAX_TILLS || noOfTills < 1) {
[Link]([Link]("Maximum number of tills is %d",
MAX_TILLS));
[Link]("Number of tills in use: ");
noOfTills = [Link]([Link]());
}
for (int i = 1; i <= noOfTills; i++) { // QP17 MP6
[Link]([Link]("Enter the till speed for till %d,
the current till speed is %d:", i, tills[i][3])); // Q17 MP7
tills[i][3] = [Link]([Link]()); // Q17 MP8
}
}
return new int[] { simulationTime, noOfTills };
}

void calculateServingTime(int[][] tills, int thisTill, int noOfItems)


{
int servingTime = (noOfItems / tills[thisTill][3]) + 1; // Q17 MP2
tills[thisTill][TIME_SERVING] = servingTime;
[Link]([Link]("%6d%6d", thisTill, servingTime));
}

public QueueSimulator() {
int buyerNumber = 0, qLength = 0, simulationTime, noOfTills,
extraTime;
int[] stats = new int[10];
int[][] tills = new int[MAX_TILLS+1][4]; // Q17 MP4

GEMS Metropole School Page 46 of 72


int[][] data = new int[MAX_TIME+1][2];
Q_Node[] buyerQ = new Q_Node[MAX_Q_SIZE];
resetDataStructures(stats, tills, buyerQ);
int[] settings = changeSettings(tills); // Q17 MP5 part
...
8

(b) Mark is for AO3 (evaluate)

**** SCREEN CAPTURE ****


Must match code from part (a), including prompts on screen capture matching those
in code.
Code for (a) must be sensible.

Screen capture showing:

1
[9]

(a) 3 marks for AO3 (design) and 9 marks for AO3 (programming)
17.
Mark
Level Description
Range

A line of reasoning has been followed to arrive at a


logically structured working or almost fully working
3 9-12
programmed solution. All of the appropriate design
decisions have been taken.

There is evidence that a line of reasoning has been


partially followed. There is evidence of some appropriate
2 5-8
design work. This is a partially working programmed
solution.

An attempt has been made to amend the subroutine


Serving and/or OutputTillAndQueueStates. Some
appropriate programming statements have been written.
There is little evidence to suggest that a line of
reasoning has been followed or that the solution has
1 1-4
been designed. The statements written may or may not
be syntactically correct and the subroutines will have
very little or none of the extra required functionality. It is
unlikely that any of the key design elements of the task
have been recognised.

GEMS Metropole School Page 47 of 72


Marking guidance:

Evidence of AO3 design - 3 marks:

Evidence of design to look for in response:

1. Attempt to test for conditions to be served at express till (in Serving).


2. Recognise the need for a loop to find next buyer with < 10 items (in
ServeBuyerExpress).
3. Recognise the need to move buyer records in BuyerQ.

Note: AO3 (design) points are for selecting appropriate techniques to use to solve
the problem, so should be credited whether the syntax of programming language
statements is correct or not and regardless of whether the solution works.

Evidence of AO3 programming - 9 marks:

Evidence of programming to look for in response:

4. Correct parameters and return values for ServeBuyerExpress.


5. Correct conditions for finding a buyer eligible for express till within loop. R. if multiple
buyers would be found in a single method call.
6. Extract buyer data only if a buyer with less than 10 items has been found.
7. Correctly move buyer records in BuyerQ.
8. Output buyer ID.
9. Call UpdateStats.
10. Call CalculateServingTime with till 0 parameter.
11. Call ServeBuyerExpress under correct conditions (QLength > 0 and till 0 free).
12. Till 0 stats included in OutputTillAndQueueStates.

Max 11 if code does not function correctly

GEMS Metropole School Page 48 of 72


[Link]

Sub ServeBuyerExpress(ByRef BuyerQ() As Q_Node, ByRef QLength As Integer,


ByRef Stats() As Integer, ByVal Tills(,) As Integer)
Dim BuyerID As String
Dim WaitingTime, Items As Integer
Dim pos As Integer = 0
While pos < QLength - 1 And BuyerQ(pos).ItemsInBasket > 9 ' Q18 MP2 MP5
pos += 1
End While
If BuyerQ(pos).ItemsInBasket < 10 Then
BuyerID = BuyerQ(pos).BuyerID ' Q18 MP6
WaitingTime = BuyerQ(pos).WaitingTime
Items = BuyerQ(pos).ItemsInBasket
For Count = pos To QLength - 1 ' Q18 MP3 MP7
BuyerQ(Count).BuyerID = BuyerQ(Count + 1).BuyerID
BuyerQ(Count).WaitingTime = BuyerQ(Count + 1).WaitingTime
BuyerQ(Count).ItemsInBasket = BuyerQ(Count + 1).ItemsInBasket
Next
BuyerQ(QLength).BuyerID = BLANK
BuyerQ(QLength).WaitingTime = 0
BuyerQ(QLength).ItemsInBasket = 0
QLength -= 1
[Link]($"{BuyerID,17}") ' Q18 MP8
UpdateStats(Stats, WaitingTime) ' Q18 MP9
CalculateServingTime(Tills, 0, Items) ' Q18 MP10
End If
End Sub

Sub Serving(Tills(,) As Integer, NoOfTills As Integer, BuyerQ() As


Q_Node, ByRef QLength As Integer, Stats() As Integer)
Dim TillFree As Integer
Dim BuyerID As String = ""
Dim WaitingTime As Integer = 0
Dim ItemsInBasket As Integer = 0
If QLength > 0 And Tills(0, TIME_SERVING) = 0 Then ' Q18 MP1 MP11
ServeBuyerExpress(BuyerQ, QLength, Stats, Tills) ' Q18 MP4
End If
TillFree = FindFreeTill(Tills, NoOfTills)
While TillFree <> -1 And QLength > 0
ServeBuyer(BuyerQ, QLength, BuyerID, WaitingTime, ItemsInBasket)
UpdateStats(Stats, WaitingTime)
CalculateServingTime(Tills, TillFree, ItemsInBasket)
TillFree = FindFreeTill(Tills, NoOfTills)
End While
IncrementTimeWaiting(BuyerQ, QLength)
UpdateTills(Tills, NoOfTills)
If QLength > 0 Then
Stats(TOTAL_Q_OCCURRENCE) += 1
Stats(TOTAL_Q) += QLength
End If
If QLength > Stats(MAX_Q_LENGTH) Then
Stats(MAX_Q_LENGTH) = QLength
End If
OutputTillAndQueueStates(Tills, NoOfTills, BuyerQ, QLength)
End Sub

Sub OutputTillAndQueueStates(Tills(,) As Integer, NoOfTills As Integer,


BuyerQ() As Q_Node, QLength As Integer)
For i As Integer = 0 To NoOfTills ' Q18 MP12
[Link]($"{i,36}{Tills(i, TIME_IDLE),5}{Tills(i,
TIME_BUSY),5}{Tills(i, TIME_SERVING),6}")
Next
[Link]("
** Start of queue **")
For i As Integer = 0 To QLength - 1

[Link]($"{BuyerQ(i).BuyerID,57}{BuyerQ(i).WaitingTime,7}{Buyer
Q(i).ItemsInBasket,6}")
Next
[Link]("
*** End of queue ***")

GEMS Metropole School Page 49 of 72


[Link]("------------------------------------------------------------------------
End Sub

Python 3

def OutputTillAndQueueStates(Tills, NoOfTills, BuyerQ, QLength):


for i in range(0, NoOfTills + 1): # Q18 MP12

print(f"{i:>36d}{Tills[i][TIME_IDLE]:>5d}{Tills[i][TIME_BUSY]:>5d}
{Tills[i][TIME_SERVING]:>6d}")
print(" ** Start of queue **")
for i in range(QLength):
print(f"{BuyerQ[i].BuyerID:>57s}{BuyerQ[i].WaitingTime:>7d}
{BuyerQ[i].ItemsInBasket:>6d}")
print(" *** End of queue ***")
print("------------------------------------------------------------------------")

def ServeBuyerExpress (Tills, BuyerQ, QLength, Stats):


# find a buyer with fewer than 10 items
Found = False
EndOfQ = False
NextInQ = 0
while not Found and not EndOfQ: # Q18 MP2 # MP5
if BuyerQ[NextInQ].ItemsInBasket < 10:
Found = True
else:
NextInQ += 1
if NextInQ == QLength:
EndOfQ = True
if Found:
# move buyer out # Q18 MP6
ThisBuyerID = BuyerQ[NextInQ].BuyerID
WaitingTime = BuyerQ[NextInQ].WaitingTime
ItemsInBasket = BuyerQ[NextInQ].ItemsInBasket
# close gap in queue
for Count in range(NextInQ, QLength): # Q18 MP3 # Q18 MP7
BuyerQ[Count].BuyerID = BuyerQ[Count + 1].BuyerID
BuyerQ[Count].WaitingTime = BuyerQ[Count + 1].WaitingTime
BuyerQ[Count].ItemsInBasket = BuyerQ[Count + 1].ItemsInBasket
# blank last element
BuyerQ[QLength].BuyerID = BLANK
BuyerQ[QLength].WaitingTime = 0
BuyerQ[QLength].ItemsInBasket = 0
QLength -= 1
print(f"{ThisBuyerID:>17s}", end='') # Q18 MP8
# update stats #Q18 MP9
Stats = UpdateStats(Stats, WaitingTime)
# serve buyer at till 0 # Q18 MP10
Tills = CalculateServingTime(Tills, 0, ItemsInBasket)
return Tills, BuyerQ, QLength, Stats

def Serving(Tills, NoOfTills, BuyerQ, QLength, Stats):


if QLength > 0: # Q18 MP1
if Tills[0][TIME_SERVING] == 0: # Q18 MP11
Tills, BuyerQ, QLength, Stats = ServeBuyerExpress (Tills, BuyerQ,
QLength, Stats) # Q18 MP4
TillFree = FindFreeTill(Tills, NoOfTills)
while TillFree != -1 and QLength > 0:
BuyerQ, QLength, BuyerID, WaitingTime, ItemsInBasket =
ServeBuyer(BuyerQ, QLength)
Stats = UpdateStats(Stats, WaitingTime)
Tills = CalculateServingTime(Tills, TillFree, ItemsInBasket)
TillFree = FindFreeTill(Tills, NoOfTills)
BuyerQ = IncrementTimeWaiting(BuyerQ, QLength)
Tills = UpdateTills(Tills, NoOfTills)
if QLength > 0:
Stats[TOTAL_Q_OCCURRENCE] += 1
Stats[TOTAL_Q] += QLength
if QLength > Stats[MAX_Q_LENGTH]:
Stats[MAX_Q_LENGTH] = QLength
OutputTillAndQueueStates(Tills, NoOfTills, BuyerQ, QLength)
return Tills, NoOfTills, BuyerQ, QLength, Stats

GEMS Metropole School Page 50 of 72


Python 2

def ServeBuyerExpress (Tills, BuyerQ, QLength, Stats):


# find a buyer with fewer than 10 items
Found = False
EndOfQ = False
NextInQ = 0
while not Found and not EndOfQ: # Q18 MP2 # Q18 MP5
if BuyerQ[NextInQ].ItemsInBasket < 10:
Found = True
else:
NextInQ += 1
if NextInQ == QLength:
EndOfQ = True
if Found:
# move buyer out # Q18 MP6
ThisBuyerID = BuyerQ[NextInQ].BuyerID
WaitingTime = BuyerQ[NextInQ].WaitingTime
ItemsInBasket = BuyerQ[NextInQ].ItemsInBasket
# close gap in queue
for Count in range(NextInQ, QLength): # Q18 MP3 # Q18 MP7
BuyerQ[Count].BuyerID = BuyerQ[Count + 1].BuyerID
BuyerQ[Count].WaitingTime = BuyerQ[Count + 1].WaitingTime
BuyerQ[Count].ItemsInBasket = BuyerQ[Count + 1].ItemsInBasket
# blank last element
BuyerQ[QLength].BuyerID = BLANK
BuyerQ[QLength].WaitingTime = 0
BuyerQ[QLength].ItemsInBasket = 0
QLength -= 1
[Link]('{0:>17}'.format(ThisBuyerID)) # Q18 MP8
# update stats # Q18 MP9
Stats = UpdateStats(Stats, WaitingTime)
# serve buyer at till 0 # Q18 MP10
Tills = CalculateServingTime(Tills, 0, ItemsInBasket)
return Tills, BuyerQ, QLength, Stats

def Serving(Tills, NoOfTills, BuyerQ, QLength, Stats):


if QLength > 0: # Q18 MP1
if Tills[0][TIME_SERVING] == 0: # Q18 MP11
Tills, BuyerQ, QLength, Stats = ServeBuyerExpress (Tills, BuyerQ,
QLength, Stats) # Q18 MP4
TillFree = FindFreeTill(Tills, NoOfTills)
while TillFree != -1 and QLength > 0:
BuyerQ, QLength, BuyerID, WaitingTime, ItemsInBasket =
ServeBuyer(BuyerQ, QLength)
Stats = UpdateStats(Stats, WaitingTime)
Tills = CalculateServingTime(Tills, TillFree, ItemsInBasket)
TillFree = FindFreeTill(Tills, NoOfTills)
BuyerQ = IncrementTimeWaiting(BuyerQ, QLength)
Tills = UpdateTills(Tills, NoOfTills)
if QLength > 0:
Stats[TOTAL_Q_OCCURRENCE] += 1
Stats[TOTAL_Q] += QLength
if QLength > Stats[MAX_Q_LENGTH]:
Stats[MAX_Q_LENGTH] = QLength
OutputTillAndQueueStates(Tills, NoOfTills, BuyerQ, QLength)
return Tills, NoOfTills, BuyerQ, QLength, Stats

def OutputTillAndQueueStates(Tills, NoOfTills, BuyerQ, QLength):


for i in range(0, NoOfTills + 1): # Q18 MP12
[Link]('{0:>36}{1:>5}{2:>5}{3:>6}'.format(i, Tills[i]
[TIME_IDLE], Tills[i][TIME_BUSY], Tills[i][TIME_SERVING]))
print
print " ** Start of queue **"
for i in range(QLength):
[Link]('{0:>57}{1:>7}{2:>6}'.format(BuyerQ[i].BuyerID,
BuyerQ[i].WaitingTime, BuyerQ[i].ItemsInBasket))
print
print " *** End of queue ***"
print
"------------------------------------------------------------------------"

GEMS Metropole School Page 51 of 72


Pascal

procedure ServeBuyerExpress (var Tills: TTills; var BuyerQ: TBuyerQ; var


QLength: integer; var Stats: TStats);
var
Found, EndOfQ: boolean;
NextInQ, WaitingTime, ItemsInBasket, Count: integer;
ThisBuyerID: string;
begin
// find a buyer with fewer than 10 items
Found := False;
EndOfQ := False;
NextInQ := 0;
while not Found and not EndOfQ do // Q18 MP2 // Q18 MP5
if BuyerQ[NextInQ].ItemsInBasket < 10 then
begin
Found := True;
end
else
begin
inc(NextInQ);
if NextInQ = QLength then
begin
EndOfQ := True;
end;
end;
if Found then
begin
// move buyer out // MP6
ThisBuyerID := BuyerQ[NextInQ].BuyerID;
WaitingTime := BuyerQ[NextInQ].WaitingTime;
ItemsInBasket := BuyerQ[NextInQ].ItemsInBasket;
// close gap in queue
for Count := NextInQ to QLength do // Q18 MP3 // Q18 MP7
begin
BuyerQ[Count].BuyerID := BuyerQ[Count + 1].BuyerID;
BuyerQ[Count].WaitingTime := BuyerQ[Count + 1].WaitingTime;
BuyerQ[Count].ItemsInBasket := BuyerQ[Count + 1].ItemsInBasket;
end;
// blank last element
BuyerQ[QLength].BuyerID := BLANK;
BuyerQ[QLength].WaitingTime := 0;
BuyerQ[QLength].ItemsInBasket := 0;
dec(QLength);
write(ThisBuyerID: 17); // Q18 MP8
// update stats // Q18 MP9
UpdateStats(Stats, WaitingTime);
// serve buyer at till 0 // Q18 MP10
CalculateServingTime(Tills, 0, ItemsInBasket);
end;
end;

procedure OutputTillAndQueueStates(var Tills: TTills; NoOfTills:


integer; var BuyerQ: TBuyerQ; QLength: integer);
var
i: integer;
begin
for i := 0 to NoOfTills do // Q18 MP12
writeln(i:36, Tills[i, TIME_IDLE]:5, Tills[i, TIME_BUSY]:5,
Tills[i, TIME_SERVING]:6);
writeln(' ** Start of queue **');
for i := 0 to QLength - 1 do
writeln(BuyerQ[i].BuyerID:57, BuyerQ[i].WaitingTime:7,
BuyerQ[i].ItemsInBasket:6);
writeln(' *** End of queue ***');
writeln('------------------------------------------------------------------------');
end;

procedure Serving(var Tills: TTills; var NoOfTills: integer; var


BuyerQ: TBuyerQ; var QLength: integer; var Stats: TStats);
var
TillFree: integer;

GEMS Metropole School Page 52 of 72


BuyerID: string;
WaitingTime, ItemsInBasket: integer;
begin
if QLength > 0 then // Q18 MP1
if Tills[0, TIME_SERVING] = 0 then // Q18 MP11
ServeBuyerExpress (Tills, BuyerQ, QLength, Stats); // Q18 MP4
TillFree := FindFreeTill(Tills, NoOfTills);
while (TillFree <> -1) and (QLength > 0) do
begin
ServeBuyer(BuyerQ, QLength, BuyerID, WaitingTime, ItemsInBasket);
UpdateStats(Stats, WaitingTime);
CalculateServingTime(Tills, TillFree, ItemsInBasket);
TillFree := FindFreeTill(Tills, NoOfTills);
end;
IncrementTimeWaiting(BuyerQ, QLength);
UpdateTills(Tills, NoOfTills);
if QLength > 0 then
begin
inc(Stats[TOTAL_Q_OCCURRENCE]);
Stats[TOTAL_Q] := Stats[TOTAL_Q] + QLength;
end;
if QLength > Stats[MAX_Q_LENGTH] then
begin
Stats[MAX_Q_LENGTH] := QLength;
end;
OutputTillAndQueueStates(Tills, NoOfTills, BuyerQ, QLength);
end;

GEMS Metropole School Page 53 of 72


C#

public static void ServeBuyerExpress(Q_Node[] BuyerQ, ref int QLength,


int[] Stats, int[,] Tills)
{
string BuyerID;
int WaitingTime, Items;
int pos = 0;
while (pos < QLength - 1 & BuyerQ[pos].ItemsInBasket > 9) // Q18 MP2
MP5
pos += 1;
if (BuyerQ[pos].ItemsInBasket < 10)
{
BuyerID = BuyerQ[pos].BuyerID; // Q18 MP6
WaitingTime = BuyerQ[pos].WaitingTime;
Items = BuyerQ[pos].ItemsInBasket;
for (int Count = pos; Count <= QLength; Count++) // Q18 MP3 MP7
{
BuyerQ[Count].BuyerID = BuyerQ[Count + 1].BuyerID;
BuyerQ[Count].WaitingTime = BuyerQ[Count + 1].WaitingTime;
BuyerQ[Count].ItemsInBasket = BuyerQ[Count + 1].ItemsInBasket;
}
BuyerQ[QLength].BuyerID = BLANK;
BuyerQ[QLength].WaitingTime = 0;
BuyerQ[QLength].ItemsInBasket = 0;
QLength -= 1;
[Link]($"{BuyerID,17}"); // Q18 MP8
UpdateStats(Stats, WaitingTime); // Q18 MP9
CalculateServingTime(Tills, 0, Items); // Q18 MP10
}
}

public static void OutputTillAndQueueStates(int[,] Tills, int NoOfTills,


Q_Node[] BuyerQ, int QLength)
{
for (int i = 0; i <= NoOfTills; i++) // Q18 MP12
{
[Link]($"{i,36}{Tills[i, TIME_IDLE],5}{Tills[i,
TIME_BUSY],5}{Tills[i, TIME_SERVING],6}");
}
[Link](" ** Start of queue **");
for (int i = 0; i < QLength; i++)
{

[Link]($"{BuyerQ[i].BuyerID,57}{BuyerQ[i].WaitingTime,7}
{BuyerQ[i].ItemsInBasket,6}");
}
[Link](" *** End of queue ***");
[Link]("------------------------------------------------------------------------")
}

public static void Serving(int[,] Tills, ref int NoOfTills, Q_Node[]


BuyerQ, ref int QLength, int[] Stats)
{
int TillFree;
string BuyerID = "";
int WaitingTime = 0;
int ItemsInBasket = 0;
if (QLength > 0) // Q18 MP1
{
if (Tills[0, TIME_SERVING] == 0) // Q18 MP11
{
ServeBuyerExpress(BuyerQ, ref QLength, Stats, Tills); // Q18 MP4
}
}
TillFree = FindFreeTill(Tills, NoOfTills);
while (TillFree != -1 && QLength > 0)
{
ServeBuyer(BuyerQ, ref QLength, ref BuyerID, ref WaitingTime, ref
ItemsInBasket);
UpdateStats(Stats, WaitingTime);
CalculateServingTime(Tills, TillFree, ItemsInBasket);

GEMS Metropole School Page 54 of 72


TillFree = FindFreeTill(Tills, NoOfTills);
}
IncrementTimeWaiting(BuyerQ, QLength);
UpdateTills(Tills, NoOfTills);
if (QLength > 0)
{
Stats[TOTAL_Q_OCCURRENCE] += 1;
Stats[TOTAL_Q] += QLength;
}
if (QLength > Stats[MAX_Q_LENGTH])
{
Stats[MAX_Q_LENGTH] = QLength;
}
OutputTillAndQueueStates(Tills, NoOfTills, BuyerQ, QLength);
}

GEMS Metropole School Page 55 of 72


Java

void outputTillAndQueueStates(int[][] tills, int noOfTills, Q_Node[]


buyerQ, int qLength) {
for (int i = 0; i <= noOfTills; i++) { // Q18 MP12
[Link]([Link]("%36d%5d%5d%6d", i, tills[i]
[TIME_IDLE], tills[i][TIME_BUSY], tills[i][TIME_SERVING]));
}
[Link]("
** Start of queue **");
for (int i = 0; i < qLength; i++) {
[Link]([Link]("%57s%7d%6d", buyerQ[i].buyerID,
buyerQ[i].waitingTime, buyerQ[i].itemsInBasket));
}
[Link]("
*** End of queue ***");
[Link]("------------------------------------------------------------------------")
}

int serveBuyerExpress(int[][] tills, Q_Node[] buyerQ, int qLength, int[]


stats)
{
boolean foundUnder10Items = false;
int buyerNumber = -1;
while (!foundUnder10Items && buyerNumber < qLength - 1) { // Q18 MP2,
MP5
buyerNumber += 1;
if (buyerQ[buyerNumber].itemsInBasket < 10) {
foundUnder10Items = true;
}
}
if (foundUnder10Items) { // Q18 MP6
String thisBuyerID = buyerQ[buyerNumber].buyerID;
int thisBuyerWaitingTime = buyerQ[buyerNumber].waitingTime;
int thisBuyerItems = buyerQ[buyerNumber].itemsInBasket;
for (int count = buyerNumber; count < qLength; count++) { // Q18 MP3,
MP7
buyerQ[count].buyerID = buyerQ[count + 1].buyerID;
buyerQ[count].waitingTime = buyerQ[count + 1].waitingTime;
buyerQ[count].itemsInBasket = buyerQ[count + 1].itemsInBasket;
}
buyerQ[qLength].buyerID = BLANK;
buyerQ[qLength].waitingTime = 0;
buyerQ[qLength].itemsInBasket = 0;
qLength -= 1;
[Link]([Link]("%17s", thisBuyerID)); // Q18 MP8
updateStats(stats, thisBuyerWaitingTime); //MP9
calculateServingTime(tills, 0, thisBuyerItems); // Q18 MP10
}
return qLength;
}

int[] serving(int[][] tills, int noOfTills, Q_Node[] buyerQ, int qLength,


int[] stats) {
int tillFree, waitingTime, itemsInBasket;
if (qLength > 0) { // Q18 MP1
if (tills[0][TIME_SERVING] == 0) { // Q18 MP 11
qLength = serveBuyerExpress(tills, buyerQ, qLength, stats); // Q18
MP4
}
}
tillFree = findFreeTill(tills, noOfTills);
while (tillFree != -1 && qLength > 0) {
String[] buyerInfo = serveBuyer(buyerQ, qLength);
qLength = [Link](buyerInfo[0]);
String buyerID = buyerInfo[1];
waitingTime = [Link](buyerInfo[2]);
itemsInBasket = [Link](buyerInfo[3]);
updateStats(stats, waitingTime);
calculateServingTime(tills, tillFree, itemsInBasket);
tillFree = findFreeTill(tills, noOfTills);
}

GEMS Metropole School Page 56 of 72


incrementTimeWaiting(buyerQ, qLength);
updateTills(tills, noOfTills);
if (qLength > 0) {
stats[TOTAL_Q_OCCURRENCE] += 1;
stats[TOTAL_Q] += qLength;
}
if (qLength > stats[MAX_Q_LENGTH]) {
stats[MAX_Q_LENGTH] = qLength;
}
outputTillAndQueueStates(tills, noOfTills, buyerQ, qLength);
return new int[] { noOfTills, qLength };
}
12

(b) Mark is for AO3 (evaluate)

**** SCREEN CAPTURE ****


Must match code from (a), including prompts on screen capture matching those in
code.
Code for (a) must be sensible.

If Question 17 has been implemented the output should be:

If Question 17 has not been implemented the output should be:

1
[13]

Mark is for AO1 (knowledge)


18.
All possible real-world quantities/values/numbers;
(Includes) the rational and irrational numbers (and the integers and natural numbers);
A value that represents any quantity along the number line;
A. All numbers excluding imaginary/complex numbers.

Max 1
[1]

Marks are for AO1 (understanding)


19.
1 mark per correct lozenge

D (5 is a natural number);
E (5 is a rational number);

R. more than two lozenges shaded


[2]

GEMS Metropole School Page 57 of 72


Mark is for AO1 (knowledge)
20.
C (ℚ);

R. more than one lozenge shaded


[1]

Mark is for AO2 (application)


21.
8A;
[1]

Mark is for AO2 (application)


22.
1000 1011;
[1]

Marks are for AO2 (application)


23.
Answer = 0100 1110;
Carry row = 0010 0011;

The 1 carry bits (or some similar notation) must be shown in the correct columns (or correct
sequence) but 0 carry bits can be omitted.
[2]

Marks are for AO2 (application)


24.
1 mark for correct conversion from 00011100 (28) to 11100100 (-28)

1 mark for binary addition of 00111011 (59) to 11100100 (-28) to give 00011111
//
2 marks for a correct final answer provided relevant working is shown and the working
uses two's complement in an attempt to solve the problem

A. If no other marks awarded, award 1 mark for correct conversion of 00111011 (59) to
11000101 (-59)

R. Reject both marks if decimal subtraction has been used


[2]

Marks are for AO2 (application)


25.
7.34375 // 7 11/32 // 235/32;

1 mark for correct integer part (or a numerator that produces the correct integer part when
an improper fraction shown)

1 mark for correct fractional part


[2]

Mark is for AO1 (knowledge)


26.
Analogue to Digital Converter // ADC;
[1]

GEMS Metropole School Page 58 of 72


Marks are for AO2 (application)
27.
2 marks for correctly showing the number of colours that can be used

25 // 32

1 mark awarded for working out the colour depth (5) used in the bitmap image if the correct
answer is not shown

[2]

Mark is for AO1 (knowledge)


28.
Metadata;
[1]

Marks are for AO2 (application)


29.
3 marks for the correct answer including the unit of time 42 seconds or 2 marks for 42 with no
time unit

If answer is incorrect then award 1 method mark for two or three steps from the list below or 2
method marks for all four steps.

• multiplying by 8000
• multiplying by 12 096
• dividing by 24 // multiplying by 24 on same side of = as the time value
• dividing by 96 000 // multiplying by 96 000 on same side of = as the time value

The following method points are equivalent to performing two of the method points in the list
above:

• multiplying by (or showing a numerator of) 96 768 000


• dividing by (or showing a denominator of) 2 304 000 // multiplying by 2 304 000 on same
side of the = as the time value
[3]

Mark is for AO1 (understanding)


30.
There is reduced quantisation error // each sample can be represented/stored more
accurately;

NE. improved sound quality


NE. increases accuracy of measurement
R. references to more samples / sample rate
[1]

GEMS Metropole School Page 59 of 72


Marks are for AO1 (understanding)
31.
Music represented as sequence of MIDI (event) messages // uses messages to represent
different events in a piece of music;
A. Music represented as sequence of instructions
NE. Music represented as sequence of notes
Playback of music is the combination of event messages with a specified ordering;
One example of data that might be contained in a message:
• Channel
• Note on / note off
• Pitch / frequency / note number
• Volume / loudness
• Velocity
• Key pressure / aftertouch
• Duration / length
• Timbre
• Instrument
• Pedal effects
• Pitch bend
• Note envelope;

MIDI messages are usually two or three bytes long;


First byte of each MIDI message is a status byte (others are data bytes);
Bit rate is 31 250 bits per second;
MSB value of 1 indicates status byte, 0 indicates data bytes;
Status bytes are divided into a command and a channel number (4 bits for each);
Sixteen channels are supported;

Max 2
[2]

Mark is for AO1 (understanding)


32.
File sizes are (typically) smaller // More compact representation;
Easy to modify/edit (at note level);
Ease of manipulation for entire recordings // easy to change recording values
(eg changing an octave for an entire score);
Easy to change instruments;
Simple method to compose algorithmically;
Musical score can be generated directly from a MIDI file;
A MIDI file can be directly output to control a device;
MIDI records the musician's inputs rather than the sound produced;
Ease of composing/combining/overlaying existing recordings;
No data lost about musical notes // no data lost through sampling;
A. "better quality" but only if there is some explanation of this e.g. "no error introduced
during sampling", "no background noise recorded"

Max 1
[1]

Mark is for AO2 (application)


33.
SOOZE;
[1]

GEMS Metropole School Page 60 of 72


Marks are for AO1 (understanding)
34.
Each letter/character is always encrypted to the same letter/character;

The letters/characters in the ciphertext will have the same frequency as their corresponding
letters/characters in the plaintext (allowing the correspondence to be worked out given
enough ciphertext);
A. The ciphertext is susceptible to frequency analysis

There are a very small number of possible keys (25 A.26) (so it can be cracked by brute
force);

If a single mapping is known then the remaining (25) can be easily calculated;

The ciphertext will retain structural properties of the plaintext message;


A. Examples of structural properties, e.g. some letters frequently occur next to each other,
some letters rarely appear next to each other, position of spaces can identify word lengths,
common short words can be identified

Max 2
[2]

Mark is for AO1 (knowledge)


35.
C (Programming language translator);
[1]

Marks are for AO1 (knowledge)


36.
Processor // microprocessor // central processing unit // CPU;

Main memory // random access memory // RAM;


A. Memory controller

Secondary storage // backing store;


A. HDD // SSD

Cache;
A. Cache controller

Power supply unit // battery management // PSU;

R. Software-implemented resources (e.g. scheduler, virtual memory, file management)

Max 2
[2]

Mark is for AO1 (knowledge)


37.
XOR // EXOR // EX-OR // Exclusive-OR // EOR;
[1]

GEMS Metropole School Page 61 of 72


Marks are for AO2 (application)
38.
1 mark for columns L and M correct

1 mark for column Z correct


A. follow through of incorrect values in columns L and M

R. Entire column if more than one value shown in any cell of that column.
[2]

Marks are for AO2 (application)


39.
Award full marks for showing correct expression:

Max 2 marks for showing partially correct expression:

1 mark for showing

1 mark for showing of C + D

1 mark for using AND and NOT gates to combine and invert subexpressions

Full marks should be awarded for equivalent expressions.


[3]

GEMS Metropole School Page 62 of 72


Marks are for AO2 (application)
40.
Marking guidance for examiners

• Award marks for working out until an incorrect step has been made.
• If, in any one step, a candidate is simplifying different parts of an expression
simultaneously award all relevant marks for this multiple stage but don't award any
further marks for working in any parts simplified incorrectly. Example, if the
expression P.P.(P+Q) + P.P.1 was changed to P.(P+Q) + P.0, the candidate would get
one mark for simplifying the first part to P.(P+Q) and could get further marks for
correctly simplifying this part of the expression further but should not be awarded
marks for simplifying the incorrectly changed part P.0 (i.e. to 0).

Award up to 3 marks for working. 1 mark per application of a technique that produces a
simplified expression. Of the 3 working marks award at most 1 mark for correctly
applying the Distributive Law to expand or introduce brackets.

Note: A simpler expression is one that is logically equivalent to the original expression but
uses fewer logical operators.

1 mark for final answer: X ⋅ Z + X ⋅ Y + W ⋅ Z or X ⋅ (Z + Y) + W ⋅ Z

Example working 1:

Example working 2 :

[4]

Marks are for AO1 (understanding)


41.
1 mark for two or three components correctly identified
2 marks for four components correctly identified

1: Memory Address Register


2: Address Bus
3: Memory Buffer Register A. Memory Data Register
4: Data Bus
[2]

GEMS Metropole School Page 63 of 72


Marks are for AO1 (knowledge)
42.
(Machine code) Instructions are stored in (main) memory;

Instructions are fetched, (decoded) and executed (serially) by the processor;

Programs can be moved in to (and out of) main memory;

Max 2
[2]

Marks are for AO1 (knowledge)


43.
Register (number);
Memory address / location;

A. offset from a memory location

Max 2
[2]

Marks are for AO1 (understanding)


44.
Increases the probability/likelihood/chance that data/instructions will be found in cache
(and cache memory is faster than main memory);

A. Increases probability/likelihood/chance of cache hit (without cache hit definition)


A. Fewer accesses to slower memory types, e.g. main memory
A. More instructions can be accessed from high speed memory

Allows for more bits to be simultaneously processed (in the execution of a single
instruction) // Allows for more bits to be simultaneously transferred (within the processor);
[2]

GEMS Metropole School Page 64 of 72


Marks are for AO3 (programming)
45.
1 mark each for each program point:

• Comparing the values in R1 and R3


A. Indirect comparisons

• Using a branch instruction to execute different blocks of code.

• Always terminating with the greater number stored in R1.

• Terminating with 1 stored in R2 when the greater number was in R1 and 3 stored in
R2 otherwise.

Max 3 marks for programming if any syntax incorrect or program does not work correctly
under all circumstances

Example 1
CMP R1, R3
BGT r1bigger
MOV R1, R3
MOV R2, #3
B Done
r1bigger: MOV R2, #1
done: HALT

Example 2
SUB R2, R1, R3
CMP R2, #0
BGT finish
MOV R2, #1
B done
finish: MOV R1, R3
MOV R2, #3
done: HALT

Example 3
MOV R2, #1
CMP R1, R3
BGT done
MOV R1, R3
MOV R2, #3
done: HALT
[4]

Marks are for AO1 (understanding)


46.
The RFID reader emits radio waves;
(The antenna in the RFID tag allows) the radio waves to induce sufficient power in the tag
to enable/power the tag // triggers an active tag;
Data is stored on the chip/memory of the tag;
In response the tag emits radio waves to transmit the data on the tag to the RFID reader;

A. Frequency or signal for radio waves

Note: Accept references to data, instead of radio waves, if it is made clear somewhere in
the response that radio waves/signals/frequencies are being used.

Max 3
[3]

GEMS Metropole School Page 65 of 72


6 marks are for AO1 (understanding)
47. 6 marks are for AO2 (analyse)

Level of response question:

Mark
Level Description
Range

A line of reasoning has been followed to produce a


coherent, relevant, substantiated and logically structured
response. Answers in this level will demonstrate a clear
and detailed awareness of the properties of solid-state
3 drives. The response covers a wide range of issues and 9-12
is likely to cover the moral ethical, legal and cultural
aspects of the question. Several of the points made will
have been expanded upon using clear examples and
references to real-world implications.

A line of reasoning has been followed to produce a


mostly coherent, relevant, substantiated and logically
structured response. Answers in this level will identify a
small number of properties of solid-state drives but may
2 5-8
fail to develop points. The response is likely to cover at
least two of moral, ethical, legal and cultural aspects of
the question. Some of the points made may have been
expanded on.

There is little evidence that a line of reasoning has been


followed. Answers in this level may identify some
properties of solid-state drives. Answers may have
1 attempted to identify some moral, ethical, legal and 1-4
cultural issues. Points are not likely to be expanded
upon but where they are, the examples may not be
relevant or may not relate to the points being made.

GEMS Metropole School Page 66 of 72


Indicative content

Area 1: Moral, ethical, legal and cultural issues

Moral (individual beliefs)


• There is the potential for the technology to be misused by criminals (e.g. stalking,
tracking partners/children/pets/strangers/property without permission).
• Criminals could put them into the pockets/luggage of targets/victims/children to find
out where they live.
• Individuals might become over-reliant on the technology and not look after their
property.
• Individuals might not wish for their phones to be used to send signals on behalf of
other users or in support of the company's network, even with encryption.

Ethical (society)
• Right to privacy eroded as your movements are tracked by the company.
• "Big Brother" society where your every move is monitored and analysed.
• Could it be used to track people in a good way, for example elderly or ill patients.
• Individuals in some jurisdictions will have had to agree for their phones to relay
signals in support of the company's network but they may not want to or even know
that they have agreed to such terms.

Legal
• As the tag moves internationally through different countries different laws will exist
about data collection and privacy.
• Computer Misuse Act would be applied in the UK to prevent unauthorised access to
the tag and the location data.
• General Data Protection Regulation (GDPR) affords protections to data subjects and
provides rights relating to access, accuracy, deletion, etc.

Cultural (subgroups)
• Older people might be very distrustful or fearful of this technology.
• This tag would only work in an area with a high number of phones / phone coverage,
therefore it is not suitable for rural locations or places with few phone users for other
reasons.
• Different societies may have different views on the privacy issues related to location
tracking.

Area 2: Suitability of storage device

Solid-state drive properties:

• Higher read and write speeds than hard disks (because there are no moving parts, it
means they'd be more likely to keep up with the requests).
• Less prone to (terminal) failure from dropping/collisions/movement (because there
are no moving parts or joints), which means there is less likelihood of costs being
incurred from damaged drives.
• Generally more energy efficient, which can lead to reduced costs (operational and/or
cooling), provide a cooler / more comfortable operating environment, and be more
environmentally friendly.
• Generally small in physical size, which means that the amount of space required to
house them / operational cost can be reduced.
• More expensive (per bit) for the same amount of memory, (which means that the
company would be investing more in the purchase of the drives initially).
• The lifetime of a solid-state drive is relatively fixed, due to there being an approximate
maximum number of writes before it becomes unreliable/unusable.
[12]

Marks are for AO1 (knowledge)


48.
Bit rate is the number of bits transmitted per second;
Baud rate is the number of times that a signal can change per second (on a medium);
[2]

GEMS Metropole School Page 67 of 72


Marks are for AO1 (understanding)
49.
Each user has equal status // each user can use and provide file sharing services // users
can individually control who can access their photographs // users manage their own
security;
Easier / less expensive to setup/maintain (than a centralised server);
Provides scalability without the need for a high-performance server/hardware;
No reliance on central server // (some of the) service remains available if one peer fails;
Max 2
[2]

Mark is for AO1 (understanding)


50.
(A locally unique) identifier (A. name) given to a wireless network // (SSID) allows a
user/device to identify/connect to (A. join) network);

N.E. To find the network without reference to identifier or connection.


[1]

Marks are for AO1 (understanding)


51.
The SSID/Service Set Identifier of the network will not be visible when trying to connect to a
network;

Only users who know the SSID of the network can connect // users who do not know the
SSID cannot connect // makes it harder for a (malicious) user to connect unless they know
the SSID;

A. name for SSID


[2]

GEMS Metropole School Page 68 of 72


Examiner reports
This question required completion of a trace table based upon a pseudocode algorithm that
1. involved concatenation of binary digits. Although the modal score was full marks, many of those
who picked up fewer marks did so as a result of a very common error, namely concatenation of a
binary string with an additional bit. Specifically, a new bit was appended to the wrong end of the
string. This error occurred when parsing the only instruction that required supplementary
explanation in the exam. This suggests that students were relatively well-prepared for commonly
encountered pseudocode expressions, but less well equipped for new and unexpected
instructions.

This was a question on the differences between global and local variables, and responses varied
2. in quality significantly. A common error was to refer erroneously to the calling of variables, which
was the most common means by which a mark point was missed. A minority of students, below
10%, provided answers of extremely good quality, which provided far more detail than needed for
either of the two-mark parts to this question. This may have had an impact upon available time in
subsequent questions.

Most students - almost 90% - demonstrated some knowledge of the advantages of using
3. structured programming, the most common single-mark attempt (on a three-mark question) being
to address understandability. This question was a good discriminator of ability.

Students generally performed very well on the pseudocode-to-code question, with almost 90%
4. securing at least six of the eight available marks in part (a). The most commonly dropped mark
point was the final one, which required an output built up of individual characters to appear on a
single line. Approximately half of the students failed to correctly implement this, with their
(otherwise correct) output being generated one character per line. This was the most common
reason for the screen capture mark not being awarded.

This question required identification of a data type and identification of a corresponding variable
5. from the skeleton code. Most students picked up all marks here, although there was a higher
level of success in identifying a data type (this being knowledge) than in identifying a variable
(this being basic analysis).

This question required identification of a data type and identification of a corresponding variable
6. from the skeleton code. Most students picked up all marks here, although there was a higher
level of success in identifying a data type (this being knowledge) than in identifying a variable
(this being basic analysis).

This question required identification of a data type and identification of a corresponding variable
7. from the skeleton code. Most students picked up all marks here, although there was a higher
level of success in identifying a data type (this being knowledge) than in identifying a variable
(this being basic analysis).

This was the first question that required students to demonstrate meaningful analytical capability
8. in the context of the skeleton program. This question asked about the purpose of a particular line
of code. Slightly more than 50% of students picked up the mark for this question, which would
have required close analysis of the skeleton code in advance of the examination.

The focus here was to explain why the skeleton code was designed and developed in a particular
9. way. Success in this question was likely to have been determined by the nature of any exam
preparation as much as by exam technique. Levels of success in this question were comparable
to the previous question, which had a similar focus.

This was a four-mark question on composition, with two marks available for a general
10. description, and two for addressing why composition was used in the skeleton program. This was
a departure from questions on previous papers, with students more likely to expect a question on
decomposition than on composition, and the quality of responses varied widely. A common
mistake was to describe subroutines or modularity in a more general sense, and only around 1%
of students gained full marks here.

GEMS Metropole School Page 69 of 72


This was a variation on a standard question, focusing on the benefits of using named constants.
11. Slightly more than 50% of students picked up at least one of the two available marks. The
generic aspect of the question - namely the benefits of using named constants - was better
answered than the specific aspect of the question, in which students were required to identify the
purpose of a specific named constant.

This question addressed the purpose of a particular loop within the skeleton program, which
12. proved a challenge for most students, with just over 50% gaining no marks on this question. This
question required students to address why a particular piece of code was written the way that it
was written, and this proved to be a challenge.

This was another question that addressed the code from an analytical standpoint, the focus here
13. being 'how does this work' rather than 'why was this approach taken'. This proved to be a
challenge and exposed a commonly held misconception: although a variable was involved in the
calculation of an average the variable itself was not an input to the calculation – the variable was
an index to an array element which was then the input to the calculation. This additional level of
complexity explains why fewer than a quarter of students gained full marks.

Here, students were required to suggest - but not implement - a change to the skeleton program.
14. For students who would have been able to implement the change, this question presented a
different challenge in that they were required to explain rather than program, demonstrating a
different skillset.

The first question of section C, in which modifications were to be made to the skeleton code. Of
15. the students who attempted this question, over 90% picked up some marks, and more than 50%
of students secured over half of the marks. Given the nature of any programming task, a wide
variety of mistakes and misconceptions was demonstrated, but most fell into one of two
categories. One common mistake was, when opening more tills in the simulation, to write code
that would allow more tills to open than actually existed. The instruction in the question paper
that provides this constraint was "...until the maximum number of tills available have opened".
Another equal common mistake was to use hard-coded values rather than variables.

This question was aimed at varying the speed at which different tills in the simulation operated,
16. and great diversity of quality was demonstrated among student answers. The most commonly
missed mark required students to provide code that wasn't explicitly requested, but that was
indicated in the question by way of "...and any code you have changed or added to the Skeleton
Program". Students generally included the required change to the parameter list of a subroutine,
but did not include evidence of the updated call to the subroutine.

By this point in the exam, a significant number of students appeared to be running low on time.
More than half of students did not submit the screen evidence required for question part (b),
which was typically indicative of a partial attempt at a question.

No student gained full marks in the final question of the paper, although every mark point on the
17. mark scheme was awarded. The most commonly missing mark was one for which students were
required to call a subroutine under two conditions, whereas only one condition appeared in their
code.

Nearly 75% of students provided no screen capture evidence for part (b), which again was
indicative of time pressure.

70% of students were able to describe the set of real numbers, many identifying it as all rational
18. and irrational numbers or as all possible real-world quantities or numbers.

More than 90% of students selected the correct two lozenges on this question.
19.
66% of students selected the correct lozenge for this question with a common error selection
20. being ℝ, the symbol for real numbers.

These conversion questions were well answered with more than 90% of students gaining the
21. marks.

These conversion questions were well answered with more than 90% of students gaining the
22. marks.

GEMS Metropole School Page 70 of 72


A large majority of students gained two marks on this question with the most common error being
23. not to show the carry bits as working.

This question on binary subtraction was answered quite well with more than half of students able
24. to achieve both marks. There were a number of responses where the students appeared to work
out the decimal values and subtract those which was not mark worthy.

This fixed-point binary question was well answered; a common mistake was to work out the
25. integer part incorrectly while correctly calculating the fractional part.

80% of students recognised the component as an Analogue to Digital Converter or ADC.


26.
60% of students managed to gain full marks on this question with the most common error being
27. not to realise that 5 bits could represent 32 different colours.

This definition question required the actual name of the additional information – "metadata" and
28. 80% of students could recall this definition.

This sound calculation question required students to work out the duration of the sound given the
29. file size, sampling resolution and rate instead of calculating the file size given duration, sampling
resolution and rate. Almost 70% of students achieved full marks with most of the rest managing
to gain some marks for working.

This understanding question was not well answered with many students referring to improved
30. quality even though this was stated in the question. The best answers simply stated there would
be "less quantisation error".

There was variable understanding of MIDI with only a quarter of students gaining both marks.
31. There were a number of answers which described MIDI as "sampled sound" or as using "more
samples". The most common single marks awarded were for examples of the data in MIDI
messages such as note or pitch. Fewer students stated that MIDI is made up of event messages.

This was a more familiar question with the need to explain an advantage of using MIDI. Almost
32. 70% of students gained the mark here with a common answer being that "it is easy to modify" – a
better answer in an explain question would be to describe what is easier to modify, eg the notes
are easy to edit / modify.

Almost 70% of students correctly applied the Caesar cipher to reveal the plaintext for this
33. question with the most common error being to apply the key in reverse, so de ciphering the
ciphertext letter W as A rather than S.

Most students scored at least one mark for their explanation of why Caesar ciphers are
34. vulnerable to being cracked. A common answer that did not gain marks was to simply state "they
can be brute forced" – of course many ciphers could be brute forced, but it is the limited number
of keys that makes Caesar ciphers especially vulnerable.

80% of students identified a "Programming language translator" as an example of system


35. software.

Half of students managed to identify two examples of hardware resources that are managed by
36. the operating system. A significant number identified I/O devices even though that example was
given in the question with others stating the management of a software resource such files.

Over 90% of students correctly identified an XOR gate.


37.
This logic trace table was answered very well with only a few students missing out on marks.
38. Some students failed to identify that output Z was the OR result of the columns L and M while
some applied an XOR instead of OR.

This question was very well answered with over 75% of students gaining full marks. A few
39. students wrote operators in words rather than using the correct symbols and some missed the
brackets needed to indicate precedence.

GEMS Metropole School Page 71 of 72


This was a challenging question with only a few students achieving full marks. However, most
40. students attempted the question and achieved at least one mark for recognising the identity Y · 1
= Y.

This labelling question was answered correctly by about half of students. Some failed to state the
41. full names of the components although this was clearly stated in the question.

The description of the stored program concept – essentially a definition – was answered fully
42. correctly by around a third of students. Common incorrect answers referred to programs being
saved for later use or to save memory.

Half of students gained one mark for this question – a good answer would have identified a
43. memory address or a register number, but many answers identified a data type such an integer
instead, even though this was already given in the question.

In this question many students struggled to describe the advantage of having a large cache
44. memory although some did state that this memory was faster to access than RAM. There were
some misunderstandings about what is stored in cache with some students writing that programs
were stored there. Greater word length was less well covered with many students just equating
this to bus size. A good answer would be that more bits can be processed at the same time –
being accurate with the idea of bits is preferable to descriptions that contain the word
"information".

Only about 20% of students achieved full marks but many more achieved two or three marks.
45. Those that missed out on the top mark had often forgotten to make sure the larger value ended
up in R1. Students often used the mnemonic LDR instead of MOV when loading an immediate
value into a register, which is incorrect.

More than half of students achieved some marks on this question, but some struggled to
46. describe the process, often substituting the idea of data for radio waves, and simply stating that
data is transferred from the tag to the reader without describing the process in any detail.

Over half of all students achieved at least six marks on this long answer question. Common
47. errors here were stating the same point in several different places in the answer, concentrating
on just one aspect instead of considering a range of issues and writing about the possible legal
actions against the company if they did not comply with legislation, which does not answer the
answer. Some students included no, or very brief, details about solid state drives and so often
failed to compare these to the use of hard disks or other secondary storage devices.

Most students achieved at least one mark on this question, and it seems that these definitions
48. are quite well known. Bit rate was described better than baud rate, but students should be careful
to include a time period (eg seconds) in their answer as some just stated it was the number of
bits transmitted.

Fewer than 20% of students achieved both marks on this question and this was often due to their
49. forgetting the scenario and just making general comments about file sharing websites. The most
common correct response was to do with the set up being cheaper due to not needing a server.

This question was well answered in general although many students described it as being the
50. "name" of a wireless network, an accept point this year. Some students confused the idea of
SSID with MAC address filtering.

Around 25% of students achieved both marks for this question. A common mistake was not to
51. explicitly state that disabling the SSID broadcast hides the identifier from users searching for a
wireless network. Some students just mentioned increased security (which is stated in the
question) without describing why this might be the case.

GEMS Metropole School Page 72 of 72

You might also like