1 A systems analyst has been employed by a busy city library to produce a new computerised system.
Explain the stages of the systems life cycle that must be completed after the design stage and describe the
documentation that the analyst must produce.
The quality of written communication will be assessed in your answer to this question.
© OCR 2022. You may photocopy this page. 1 of 39 Created in ExamBuilder
[8]
2 Beryl has to write a program that explains patterns in crystals, using the following information.
All the patterns in crystals have two lengths, x and y, and an angle A.
If A is 90° you need to check the lengths.
If the lengths are equal it is a square crystal.
If the lengths are not equal it is a rectangular crystal.
If A is not 90° it may be a hexagonal crystal. These crystals have angles of 60° and 120° and the lengths are
always equal.
If A is not 60° or 90° or 120° it must be a parallelogram crystal if the lengths are not equal, or a rhombic
crystal if the lengths are equal.
© OCR 2022. You may photocopy this page. 2 of 39 Created in ExamBuilder
During alpha testing, both white box testing and black box testing are used.
(i) State what is meant by alpha testing.
[1]
(ii) Describe how Beryl will use white box testing in her program.
© OCR 2022. You may photocopy this page. 3 of 39 Created in ExamBuilder
[2]
(iii) Beryl prepares a set of test data for black box testing. Three test cases where the angle is exactly 90° are
given in the table below.
Complete the table by stating the values of x and y to be tested, the reason for the test and the expected
outcome. The first row has been completed as an example.
Test data Reason for test Expected outcome
A = 90
The angle is exactly 90 and the two sides SQUARE
x = 100 are exactly equal
y = 100
A = 90
x = ______________
y = ______________
A = 90
x = ______________
y = ______________
[6]
© OCR 2022. You may photocopy this page. 4 of 39 Created in ExamBuilder
3(a) Resistors are small components of electronic circuits. The value of a resistor is printed on the resistor using
colour bands. Three bands on the left show the resistance. A gold or silver band on the right shows the
tolerance, as in Fig. 1.
Mr Johnson teaches Electronics to year 7. He is worried that pupils sometimes use a resistor with the wrong
value. He writes a program that pupils can use to check the value of a resistor.
Mr Johnson has designed the following interface for his program.
Describe three ways that the design of this interface helps to make the program effective.
© OCR 2022. You may photocopy this page. 5 of 39 Created in ExamBuilder
3
[6]
(b) If the band on the right of the resistor is gold the tolerance is 5%. If the band is silver the tolerance is 10%.
Here is an extract from Mr Johnson's code.
State the name of the control structure used in this extract.
[1]
(c) Mr Johnson has not used indentation.
(i) State what is meant by indentation.
[1]
(ii) Explain, using an example, why Mr Johnson should use indentation in this code.
[2]
© OCR 2022. You may photocopy this page. 6 of 39 Created in ExamBuilder
(d) When the band on the right is missing, the value of ColourBand4 is the empty string and the tolerance is 20%.
Mr Johnson's code does not work correctly for this type of resistor.
(i) State the output from Mr Johnson's code when the value of ColourBand4 is the empty string.
[1]
(ii) Rewrite Mr Johnson's code so that it also works correctly for this type of resistor.
You should use nested IF statements and indent the code correctly.
[4]
© OCR 2022. You may photocopy this page. 7 of 39 Created in ExamBuilder
(e) The three bands on the left of the resistor use a colour code to represent the digits from 0 to 9.
Mr Johnson has written the following function to convert each colour to its value.
This function uses SELECT CASE instead of IF statements.
Explain why SELECT CASE is more appropriate than IF statements in this function.
[3]
© OCR 2022. You may photocopy this page. 8 of 39 Created in ExamBuilder
(f) The function above contains a syntax error.
(i) State what is meant by a syntax error.
[1]
(ii) Identify the syntax error in the function.
[1]
(iii) State the name of a different type of program error, other than a syntax error.
[1]
© OCR 2022. You may photocopy this page. 9 of 39 Created in ExamBuilder
(g) The variables ColourBand1, ColourBand2 and ColourBand3 contain the colours of the three bands on the left of
the resistor.
The value represented by ColourBand1 is the first digit of the resistance.
The value represented by ColourBand2 is the second digit of the resistance.
The value represented by ColourBand3 is the number of zeros to be concatenated. However, if there are
three or more zeros, the last three zeros should be replaced by the letter k.
Write an algorithm that will output the resistance of a resistor as a string in the form “Resistance = 27Q”
[8]
© OCR 2022. You may photocopy this page. 10 of 39 Created in ExamBuilder
4 ChillDel Ltd have decided to install a satellite tracking system on each vehicle, which will be linked to the
company's main database to keep track of deliveries.
Testing will be performed by the development team during development of the program.
Name and describe three testing strategies that may be used.
1.
Name _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
Description _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
2.
Name _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
Description _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
3.
Name _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
Description _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
[9]
© OCR 2022. You may photocopy this page. 11 of 39 Created in ExamBuilder
5 A programmer has been asked to produce a procedure that will generate a unique username from a person's
first name, surname and date of birth (DoB ‐ dd/mm/yyyy). The username is a fixed length of 14 characters.
The format of the username is:
the first three characters of the first name
two random digits (taken from DoB)
the last three characters of the surname
day of birth, month of birth and the last two digits of year of birth.
For example, John Smith born on 12/03/1989, could give Joh29ith120389.
The programmer has written the following function to generate a random digit from the DoB:
1 FUNCTION RandomDigit(DateOfBirth: STRING) :CHAR
2 INTEGER P
03 P=0
04 WHILE ((P < 1 ) OR (P > 10))
5 P = RANDINT(1,10) { RANDINT produces an INTEGER value between 1 and 10 inclusive.}
6 IF ((P = 3) AND (P = 6)) THEN
07 P=0
8 ENDIF
9 END WHILE
10 RETURN MID(DateOfBirth,P,1)
11 END FUNCTION
(i) The function compiles correctly, but when tested the function sometimes returns the symbol / rather than a
digit.
Name this type of error and state how it can be corrected.
Type of error _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
Correction required _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
[2]
(ii) Identify two improvements that could be made to the code to make it easier to maintain.
© OCR 2022. You may photocopy this page. 12 of 39 Created in ExamBuilder
Provide examples from the code to support your answer.
[4]
(iii) Using the function RandomDigit, complete the following procedure to generate the user name (UserName).
PROCEDURE Generate(UserName:STRING; FirstName:STRING; Surname:STRING; DoB:STRING)
UserName=“ ” {Initialise to zero length STRING}
END PROCEDURE
[5]
© OCR 2022. You may photocopy this page. 13 of 39 Created in ExamBuilder
(iv)
Describe two differences between a function and a procedure.
[6]
6(a) The procedure below manipulates a passed integer value and gives a single or multiple outputs.
PROCEDURE ChangeInteger(Value:INTEGER)
INTEGER P, X, M
REPEAT
P = Value DIV 10
X = P * 10
M = Value − X
OUTPUT M
Value = P
UNTIL Value <= 0
© OCR 2022. You may photocopy this page. 14 of 39 Created in ExamBuilder
OUTPUT ‘+’
END PROCEDURE
For example, ChangeInteger(1234) would output 4 3 2 1 +
(i) Complete the trace table for the following procedure call ChangeInteger(4082).
Value P X M OUTPUT
[3]
(ii) Complete the trace table for the following procedure call ChangeInteger(-243).
Value P X M OUTPUT
[2]
© OCR 2022. You may photocopy this page. 15 of 39 Created in ExamBuilder
(b) The output produced for a negative value is not in the correct format of digit(s) and a single sign. Modify the
procedure ChangeInteger to give the correct format output for both positive and negative values.
[4]
© OCR 2022. You may photocopy this page. 16 of 39 Created in ExamBuilder
7 Asim is the head of a chess club. One of his jobs is to send out a monthly newsletter.
For the newsletter, club members send in descriptions of games they play using chess notation, which consist of
a sequence of symbols, letters and numbers. It is important that these descriptions are accurate.
Identify and describe one method of verification that members could use to help reduce the chance of an error
being made.
[2]
8 *A software company is going to write a policy on its use of variables when writing programs. The policy will
cover the use of local and global variables and variable naming rules and conventions.
Discuss the content of this policy and why it is required.
[9]
© OCR 2022. You may photocopy this page. 17 of 39 Created in ExamBuilder
© OCR 2022. You may photocopy this page. 18 of 39 Created in ExamBuilder
9(a) A software development company is planning to produce a bespoke monitoring system for a factory which
produces hazardous chemicals. One testing strategy is whitebox testing.
State the name of three other testing strategies that the company could use.
[3]
(b) The company decide to use whitebox testing. Justify why whitebox testing is used in this case.
[3]
© OCR 2022. You may photocopy this page. 19 of 39 Created in ExamBuilder
(c) A temperature control system monitors and regulates temperature by switching a heater on or off. The
temperature sensor of the system provides a reading accurate to 3 decimal places (e.g. 87.489). There are two
warning lights, amber and red. The system controls the temperature and warning lights as follows:
The heater is turned off when the sensor reading is 97.500.
The heater is turned on when the sensor reading is 95.000.
The red warning light is on when the sensor reading is 98.100 or above.
The amber warning light is on when the sensor reading is outside the range 95.000 to 97.500 (inclusive), and
the red warning light is not on.
Complete the boundary test table below.
Sensor value Output On/off
94.999 Amber light on
95.000 Heater
Amber light
97.500 Heater
Amber light
97.501 Amber light
98.099 Amber light
Red light
98.100 Amber light
Red light
[5]
© OCR 2022. You may photocopy this page. 20 of 39 Created in ExamBuilder
10 A programmer is going to design a procedure that will prompt for and receive two values, A and B. The
procedure will then compare them. The procedure will also write a suitable message to a file on disk depending
on whether:
the values are the same
A is less than B, or
B is less than A.
Use pseudocode to write the procedure.
[5]
© OCR 2022. You may photocopy this page. 21 of 39 Created in ExamBuilder
11(a) Given the following pseudocode:
State the value of d if a=42, b=41 and c=42
______________
(b) State the value of d if a=42, b=36 and c=4
______________
(c) State the value of d if a=42, b=36 and c=36
______________
(d) Give one potential value of b if the output value of a=42, c=44 and d=14.
______________
[4]
12(a) A 2-dimensional (2D) array, data, holds numeric data that Karl has entered. The declaration for the array is:
array data[16,11]
The array data, has 16 ‘rows’ and 11 ‘columns’.
© OCR 2022. You may photocopy this page. 22 of 39 Created in ExamBuilder
Fig. 1.1 shows an extract from data.
Fig. 1.1
The data in each ‘row’ is in ascending numerical order.
Karl needs to analyse the data.
Karl needs to output the median value of each ‘row’ of the array.
The median is found by having all the numbers in a row in ascending numerical order, and taking the middle
value.
For example, in Fig. 1.2 below, the median element in the row is the third element, so the median value is 7.
1 5 7 12 15
Fig. 1.2
Write an algorithm to output the median value of each ‘row’ of the 2D array data.
[3]
© OCR 2022. You may photocopy this page. 23 of 39 Created in ExamBuilder
(b) Karl needs to find the mean average of each ‘column’ of the array. The mean is calculated by adding together
the numbers in the column, and dividing by the quantity of numbers in the column.
For example, in Fig. 1.3 the first ‘column’ mean would be: (1+3+0+12)/4 = 4
1 5 7 12
3 4 15 16
0 0 1 3
12 16 18 23
Fig. 1.3
Write an algorithm to output the mean value of each ‘column’ in the array data.
[5]
© OCR 2022. You may photocopy this page. 24 of 39 Created in ExamBuilder
13 A group of A-level students are working together to program a computer game.
In the game, the player controls a character who moves through a virtual world. The game starts with a load-up
screen. The player can select which area to move to on an on-screen map, and then they control the movements
of their character using a keyboard to solve puzzles on the screen.
Discuss the need for, and benefits of, the students producing and using reusable program components
in the development of the game.
© OCR 2022. You may photocopy this page. 25 of 39 Created in ExamBuilder
[9]
© OCR 2022. You may photocopy this page. 26 of 39 Created in ExamBuilder
14
A procedure takes as input a number between 1 and 100. It calculates and outputs the square of each number
starting from 1, to the number input. The square of a number is the result of multiplying a number by itself.
The procedure needs to be tested.
(i) Describe how black box testing can be used to test a program.
[3]
(ii) For each type of test given in the table, identify two examples of test data that can be used to test the
program.
Test Type Test Data 1 Test Data 2
Normal
Extreme
Invalid
[3]
© OCR 2022. You may photocopy this page. 27 of 39 Created in ExamBuilder
15 A user enters whole numbers into a computer program. Each number entered is placed onto a stack. The stack
is created using an array with a maximum of 20 elements.
Part of the array, numStack, is shown when one number has been input.
index stackItem
9
8
7
6
top 1 5
4
3
2
1
0 20
The pointer, top, points to the next free space in the stack.
A function, addItem, takes a number as a parameter and adds the number to the stack. The function returns
true if this was successful, and false if the stack is already full.
(i) Give one reason why a function is used instead of a procedure in this scenario.
[1]
(ii) The parameter can be passed by value or by reference.
Describe what is meant by passing a parameter by value and by reference.
By value
© OCR 2022. You may photocopy this page. 28 of 39 Created in ExamBuilder
By reference
[4]
(iii) The function addItem is written but is incomplete.
Complete the function, addItem.
function addItem (number)
if top == ............................................ then
return false
else
numStack [.........................] = .........................
top = ................................. + 1
.........................................................
endif
endfunction
[5]
(iv) The procedure, calculate, takes each item in turn from the stack. It alternately adds then subtracts the
numbers until there are none left.
For example, if numStack contains: 2
6
5
12
It would perform 2 + 6 − 5 + 12 and output 15.
© OCR 2022. You may photocopy this page. 29 of 39 Created in ExamBuilder
01 procedure calculate()
02 total = 0
03 add = true
04 if top == 0 then
05 print("Stack empty")
06 else
07 total = numStack[top - 1]
08 top = top ? 1
09 while top != 0
10 if add == true then
11 total = total + numStack[top - 1]
12 add = false
13 else
14 total = total ? numStack[top - 1]
15 add = true
16 endif
17 top = top - 1
18 endwhile
19 print(total)
20 endif
21 endprocedure
Complete the trace table for the procedure calculate. The current array and pointer values when the
procedure is called are on the first line of the trace table.
numstak
top 0 1 2 3 4 5 total add output
5 20 2 6 12 8
[6]
© OCR 2022. You may photocopy this page. 30 of 39 Created in ExamBuilder
16(a) A games company has developed a game called Kidz Arrowz. The players throw an arrow at a target board and
are awarded different points depending on which circle the arrow lands. Fig. 1 shows the board.
Fig. 1
A computer program is required to keep track of the scores for each competition. The user will enter the number
of players, and the name of each player, in that competition to a maximum of 10.
(i) The program will then ask for the score of each player in turn. Each competition has 8 rounds, with each
player throwing one arrow each round. The program will then display the total score of each player.
The players are declared as a record structure:
record player(string playerName, integer totalScore)
Describe what is meant by a record structure.
[2]
© OCR 2022. You may photocopy this page. 31 of 39 Created in ExamBuilder
(ii) The records for the players are stored in a 1D array.
State why a 1D array is a suitable data structure for the records.
[1]
(iii) Three data structures are arrays, records and stacks.
Identify one other data structure.
[1]
(b) Player 1 is named Johnny. In the first round Johnny scores 3. Johnny can be added to the array using the code:
scores[0].playerName = "Johnny"
scores[0].totalScore = 3
(i) Write an algorithm to:
• allow the user to input and validate the number of players
• allow the user to input the name of each player
• output the round number at the start of a round
• display the player number for the score that needs to be entered
• allow the user to input the score for each player in that round and add it to their total.
© OCR 2022. You may photocopy this page. 32 of 39 Created in ExamBuilder
[7]
(ii) Write an algorithm to output:
• the total score of each player with their name e.g. Johnny scored 38
• the average (mean) score of each player over the 8 rounds, with their name e.g. If Johnny’s total score
is 38, then Johnny’s average is 4.75.
© OCR 2022. You may photocopy this page. 33 of 39 Created in ExamBuilder
[4]
© OCR 2022. You may photocopy this page. 34 of 39 Created in ExamBuilder
17 * A software company is developing a mobile phone application for a client which will allow customers to book
cinema tickets, and is deciding between using the waterfall lifecycle or rapid application development.
Discuss the two software development methodologies the software company is considering and
recommend which it should use. [9]
© OCR 2022. You may photocopy this page. 35 of 39 Created in ExamBuilder
© OCR 2022. You may photocopy this page. 36 of 39 Created in ExamBuilder
18 Janet is designing a piece of software for a furniture company.
The software will allow a user to plan the position of furniture in a room. Users will be able to set the size and
shape of a room, and then choose furniture from a library of furniture items. These pieces of furniture will have
set sizes and designs and the user will be able to view the room in 3D to see how it looks from a variety of
angles.
The program allows the user to enter dimensions of the room and the furniture. There are preconditions that
must be met before the software will draw the room and furniture.
Suggest two preconditions that must be met before the software will run.
[2]
© OCR 2022. You may photocopy this page. 37 of 39 Created in ExamBuilder
19 The Little Man Computer (LMC) instruction set can be used to write programs using assembly language.
Fig. 3 shows assembly code written using the LMC instruction set.
Fig. 3
(i) Tick one box to indicate the programming construct that is not used in Fig. 3.
Sequence
Selection
Iteration
[1]
(ii) When the program is run, 7 is input by the user.
State the value that will be in the memory location Z when the program has run with this input.
[1]
(iii) Write an equivalent version of the LMC assembly code shown in Fig. 3 for a procedural programming
language.
© OCR 2022. You may photocopy this page. 38 of 39 Created in ExamBuilder
You should write your code using pseudocode or program code.
[4]
END OF QUESTION PAPER
© OCR 2022. You may photocopy this page. 39 of 39 Created in ExamBuilder
Powered by TCPDF ([Link])