0% found this document useful (0 votes)
12 views

1.2.4 End of Module Test

Uploaded by

aljulanda1233
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

1.2.4 End of Module Test

Uploaded by

aljulanda1233
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

1 Christoff is writing a program to simulate a city using object-oriented programming.

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

© OCR 2024. You may photocopy this page. 1 of 14 Created in ExamBuilder


to the first array position in the road.

[4]

© OCR 2024. You may photocopy this page. 2 of 14 Created in ExamBuilder


2 Laser Tag is a game where teams of players move round an arena shooting each other with infrared guns.
Players wear sensors that keep track of how many times they have been hit by the laser. This is known as being
‘tagged’.

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]

© OCR 2024. You may photocopy this page. 3 of 14 Created in ExamBuilder


3 * In assembly language, different modes of addressing memory can be used.

Discuss the different modes used. You should include:

• How the operand value is determined


• What an operand of 27 would refer to in that mode
• The reasons for requiring multiple modes of addressing [12]

© OCR 2024. You may photocopy this page. 4 of 14 Created in ExamBuilder


© OCR 2024. You may photocopy this page. 5 of 14 Created in ExamBuilder
4 * Procedural programming and object-oriented programming are two paradigms commonly used by
programmers when developing computer games.

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.

© OCR 2024. You may photocopy this page. 6 of 14 Created in ExamBuilder


[12]

© OCR 2024. You may photocopy this page. 7 of 14 Created in ExamBuilder


5 Caz is studying low-level languages. She has lost some of her notes on modes of addressing, but has the
following part of an example.

Address in current instruction register (CIR) is 3


Address to be used is 3+11=14

Name and explain two modes of addressing that this example could show.

[4]

© OCR 2024. You may photocopy this page. 8 of 14 Created in ExamBuilder


6 A program written in the Little Man Computer instruction set is given below.

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]

END OF QUESTION PAPER

© OCR 2024. You may photocopy this page. 9 of 14 Created in ExamBuilder


Mark Scheme

Question Answer/Indicative content Marks Guidance

1 1 mark per bullet up to a maximum of 4 4 AO2.1


marks: (1) AO3.2
(3)
Creating a new instance of house with
identifier houseOne
…with the correct parameters
Creating a new instance of houseRoad
named limeAvenue
…sending houseOne as parameter to
the constructor

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

© OCR 2024. You may photocopy this page. 10 of 14 Created in ExamBuilder


Mark Scheme

Question Answer/Indicative content Marks Guidance

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.

Mark Band 1-Low Level (1-4 marks)


The candidate demonstrates a basic

© OCR 2024. You may photocopy this page. 11 of 14 Created in ExamBuilder


Mark Scheme

Question Answer/Indicative content Marks Guidance

knowledge of different modes of


addressing; the material is basic and
contains some inaccuracies. The candidate
makes a limited attempt to apply acquired
knowledge and understanding to the
context provided.

The candidate provides a limited


discussion which is narrow in focus.
Judgments if made are weak and
unsubstantiated. The information is basic
and communicated in an unstructured way.
The information is supported by limited
evidence and the relationship to the
evidence may not be clear.

0 marks
No attempt to answer the question or
response is not worthy of credit.

Total 12

© OCR 2024. You may photocopy this page. 12 of 14 Created in ExamBuilder


Mark Scheme

Question Answer/Indicative content Marks Guidance

4 Mark Band 3–High Level (9-12 marks) 12 AO1


Object oriented programming makes use of
The candidate demonstrates a thorough AO1.1 classes (templates) from which objects are
knowledge and understanding of (2) made.
procedural and object oriented AO1.2 Classes have attributes and methods
programming. The material is generally (2) Classes can be encapsulated by making
accurate and detailed. AO2.1 attributes private and providing public
(23 access methods
The candidate is able to apply their AO3.3 Object oriented programming supports
knowledge and understanding directly and (5) inheritance which allows classes to use
consistently to the context provided. attributes and methods of parent classes.
Evidence/examples will be explicitly Object oriented programming supports
relevant to the explanation. polymorphism meaning that class
attributes and methods can take on many
The candidate provides a thorough different forms if required.
discussion which is well balanced.
Evaluative comments are consistently AO2
relevant and well-considered. OO approach would call on classes per
type of player or enemy object
There is a well-developed line of reasoning Objects made from these classes, so one
which is clear and logically structured. The enemy class may generate many enemy
information presented is relevant and objects, each with different values for their
substantiated. attributes (e.g. speed, energy)
Special types of Player or Enemy objects
Mark Band 2-Mid Level (5-8 marks) could be instantiated from classes that
inherit from the original Player/Enemy
The candidate demonstrates reasonable classes, but have attributes/methods of
knowledge and understanding of their own.
procedural and object oriented Polymorphism would allow for the
programming; the material is generally attributes/methods of Player/Enemy
accurate but at times underdeveloped. objects to behave differently from normal if
required.
The candidate is able to apply their
knowledge and understanding directly to AO3
the context provided although one or two OO promotes a modular approach
opportunities are missed. (procedural through use of subroutines,
Evidence/examples are for the most part OO through classes).
implicitly relevant to the explanation. OO is an abstraction of a real world
problem, with classes for each type of
The candidate provides a sound things to be modelled and objects for each
discussion, the majority of which is instance of these.
focused. Evaluative comments are for the OO has advantages in data security in that
most part appropriate, although one or two encapsulation forces developers/users to
opportunities for development are missed. use methods
There is a line of reasoning presented with (with their built in validation) to
some structure. The information presented access/amend data stored in attributes.
is in the most part relevant and supported OO has advantages in efficiency of design
by some evidence. where classes can be reused and can
inherit from one another. Procedural

© OCR 2024. You may photocopy this page. 13 of 14 Created in ExamBuilder


Mark Scheme

Question Answer/Indicative content Marks Guidance

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

© OCR 2024. You may photocopy this page. 14 of 14 Created in ExamBuilder

Powered by TCPDF (www.tcpdf.org)

You might also like