1.2.4 End of Module Test
1.2.4 End of Module Test
He is designing classes to
store different types of buildings and their location on the road. He has created the following plan for some of the
buildings:
Christoff wants to create a new house called houseOne. It has the properties: 2 floors, 8(m) width, 10(m) height,
3 bedrooms and 2 bathrooms.
The house is located on a road with the identifier limeAvenue of type houseRoad, houseOne is the first house
in this road.
Write pseudocode or program code to declare the house houseOne, road limeAvenue and assign houseOne
[4]
At the end of each match players upload their score to a computer. The computer stores the scores in the order
they are received in a 2D array called . The array stores the team as an integer (1 for green, 2 for red)
and their score. An extract of the array called is shown below. The first entry shows a green team
member scored 45 points and the next shows a red team member scored 30 points.
1 45
2 30
2 46
1 31
1 10
1 32
2 2
Once all the players have uploaded their scores the computer adds up the scores for each team.
Using pseudocode write a program for a procedural language that works out and outputs the total score for each
team. You may assume that there are always 20 players.
[6]
Discuss the advantages of using object-oriented programming over procedural programming when developing
computer games. You should refer to inheritance, encapsulation and polymorphism in your answer.
Name and explain two modes of addressing that this example could show.
[4]
INP
STA num
loop LDA total
ADD num
STA total
LDA count
ADD one
STA count
SUB num
BRZ end
BRA loop
end LDA total
OUT
HLT
one DAT 1
num DAT 0
count DAT 0
total DAT 0
The code uses direct addressing. Describe one other mode of addressing.
[2]
e.g.
houseOne = new house(2, 8, 10,
3, 2)
limeAvenue = new
houseRoad(houseOne)
Total 4
2 Team scores are initialised (prior to 6 Up to 6 marks – 1 mark for each correct
loop) (1). step in process. Any program with the
Iterates through array correct number specified functionality should receive full
of times (1). marks.
Checks the team the player is on (1).
If the player is green adds score to the Example:
greenTeam (1).
If the player is red adds score to the
redTeam (1).
Outputs result in a sensible manner
(1).
Total 6
3 Mark Band 3–High Level (9-12 marks) 12 AO1.1 AO1 Immediate addressing is where the
The candidate demonstrates a thorough (2), operand holds the actual data to be used;
knowledge and understanding of different AO1.2 no address referenced
modes of addressing. The material is (2), Direct addressing is where the operand
generally accurate and detailed. AO2.1 holds the address that holds the data to be
(3), used.
The candidate is able to apply their AO3.3. Indirect addressing is where the operand
knowledge and understanding directly and (5) holds an address which is where the data
consistently to the context provided. to be used is stored
Evidence/examples will be explicitly Indexed addressing is where the operand
relevant to the explanation. holds an address which is offset using the
Index Register to find the true address of
The candidate provides a thorough the data to be used
discussion which is well balanced.
Evaluative comments are consistently AO2
relevant and well-considered. Immediate addressing; operand of 27
would refer to the value 27
There is a well-developed line of reasoning Direct addressing; operand of 27 would tell
which is clear and logically structured. The the processor to fetch the data held at
information presented is relevant and address 27.
substantiated. Indirect addressing; operand of 27 would
tell the processor to fetch the data held at
Mark Band 2-Mid Level (5-8 marks) address 27, which itself would then be
The candidate demonstrates reasonable used an address to fetch data from.
knowledge and understanding of different Indexed addressing; operand of 27 would
modes of addressing; the material is be added to the value of the Index register
generally accurate but at times and this would then be used as the
underdeveloped. address to fetch data from.
AO3
The candidate is able to apply their Immediate addressing allows simple
knowledge and understanding directly to access to data with no fetch required, but
the context provided although one or two limited by the data size of the operand.
opportunities are missed. Direct addressing allows data to be fetched
Evidence/examples are for the most part from memory. Data can potentially be
implicitly relevant to the explanation. larger in size that with immediate
addressing but address range limited by
The candidate provides a sound size of operand.
discussion, the majority of which is Indirect addressing allows a larger range of
focused. Evaluative comments are for the addresses to be accessed as address
most part appropriate, although one or two fetched. However, multiple fetches
opportunities for development are missed. required to access data.
Indexed addressing allows the Index
There is a line of reasoning presented with register to be manipulated to access data
some structure. The information presented stored sequentially e.g. in an array.
is in the most part relevant and supported
by some evidence.
0 marks
No attempt to answer the question or
response is not worthy of credit.
Total 12
Mark Band 1-Low Level (1-4 marks) programming struggles to support this.
OO also offers flexibility through
The candidate demonstrates a basic polymorphism.
knowledge of procedural or object oriented
programming; the material is basic and
contains some inaccuracies. The candidate
makes a limited attempt to apply acquired
knowledge and understanding to the
context provided.
Total 12
5 Relative addressing… 4
…uses offset 3 to calculate real address Examiner's Comments
from base address 11
Indexed addressing… Another question that was expected to
…modifies address 3 by adding number 11 differentiate between candidates. Those of
from index register higher ability generally managed to get
three or four marks on this question, most
candidates could get one or two marks by
addressing modes but the difference was
in the ability to describe what it did.
Total 4
6 – Immediate addressing… 2
– …operand is the value to be used. Examiner’s Comments
– Indirect Addressing… AO1.1
– …operand is the memory location Many candidates correctly cited another
holding a value representing the mode of addressing outlined in the
memory location to be used. specification but descriptions invariably
– Indexed Addressing… lacked clarity, with the exception of
– …Operand is added to contents of Immediate Addressing.
Index Register to get memory location
of value needed.
(1 mark for naming addressing mode, 1
mark for correct description)
Total 2