1.2.2 Applications Generation
1.2.2 Applications Generation
1. Livid Lizards is a computer game in which players get to fire lizards from a cannon to knock down walls. Players
get to pick different types of lizards, each with qualities and special powers.
The game is coded using an object-oriented language. Below is the code for the lizard class:
The game uses a 2D graphics library. Explain why a linker would need to be used after compilation.
[3]
PhysicsAndMathsTutor.com
2. State three benefits of using library routines when a program is written.
[3]
PhysicsAndMathsTutor.com
3. Describe what happens during syntax analysis, when code is compiled.
[5]
PhysicsAndMathsTutor.com
4. A software development team is writing a word game.
The software team use a prebuilt library to create the Graphical User Interface.
[2]
(ii) The program is compiled. Explain the process of compilation including how code from the library
becomes part of the finished program, justifying why each stage is necessary.
PhysicsAndMathsTutor.com
[9]
PhysicsAndMathsTutor.com
Question Answer/Indicative content Marks Guidance
1 The user running the program will not 3 Up to 3 marks for a valid explanation.
necessarily have the library installed on
their machine (1) therefore the relevant
code needs to be included within the
final executable (1) – it is the job of the
linker to combine this code (1).
Total 3
Total 3
Examiner's Comments
Statements / tokens are checked…
… against the rules / grammar of the Again the Principal Examiner was looking
language for more technical knowledge with this
valid example given question and it was apparent from the
range of answers given that this was one
3 Marks from this section question that showed true understanding of
the subject.
Total 5
PhysicsAndMathsTutor.com
Question Answer/Indicative content Marks Guidance
Examiner’s Comments
Those candidates who cited generic
(Max 2) advantages of using subroutines as
opposed to library routines did not gain
credit. The question asked for advantages
to the team of using a library.
ii Mark Band 3–High Level AO1.1 Points may include but are not limited to:
(7–9 marks)
The candidate demonstrates a (2) AO1 Knowledge and Understanding
thorough knowledge and
understanding of how source code is AO1.2 The compiler is effectively a group of
compiled and library code programs.
incorporated. The material is
generally accurate and detailed. (2) The stages of compilation are: lexical
analysis, syntax analysis, code generation
The candidate is able to apply their and optimisation.
knowledge and understanding AO2.1
directly and consistently to the A linker is then used to combine the object
context provided. Evidence / (2) code with the library code to make the final
examples will be explicitly relevant executable.
to the explanation. AO3.3
AO2.1 Application
The candidate provides a thorough (3)
discussion which is well balanced. Source code is input into a compiler
Evaluative comments are program.
consistently relevant and well- 9
considered. The first stage is lexical analysis in which..
PhysicsAndMathsTutor.com
Question Answer/Indicative content Marks Guidance
Mark Band 2–Mid Level (4–6 marks) The series of tokens and symbol table is
The candidate demonstrates passed onto the next stage, syntax
reasonable knowledge and analysis:
understanding of how source code is Here the code is checked to ensure it
compiled and library code follows the rules of the language.
incorporated; the material is
generally accurate but at times This is often accomplished by placing the
underdeveloped. tokens into a (abstract syntax) tree.
The candidate is able to apply their Where it breaks the rules of the language
knowledge and understanding errors are generated.
directly to the context provided
although one or two opportunities If no rules are broken then it’s passed on to
are missed. Evidence / examples the next stage…
are for the most part implicitly
relevant to the explanation. ..Which is code generation.
The candidate provides a sound Here the object code (accept machine
discussion, the majority of which is code) is created.
focused. Evaluative comments are
for the most part appropriate, (i.e. the binary that is executed by the
although one or two opportunities for processor)
development are missed.
This code may be inefficient..
There is a line of reasoning
presented with some structure. The .. it may contain unnecessary instructions
information presented is in the most or groups of instructions that can be
part relevant and supported by some replaced by simpler ones.
evidence.
Code from the library is likely already
Mark Band 1–Low Level (1–3 marks) compiled.
The candidate demonstrates a basic
knowledge of how source code is And may well have been written in a
compiled and / or library code different language to the main program.
incorporated; the material is basic
and contains some inaccuracies. The main program source code will have
The candidate makes a limited contained lines importing the library code.
attempt to apply acquired knowledge
and understanding to the context A program called a linker can incorporate
provided. the code from the library with the main
program…
The candidate provides a limited …into a single executable file.
discussion which is narrow in focus. An alternative approach is for the main
Judgments if made are weak and executable to link to the compiled library
unsubstantiated. The information is code (i.e. dynamic linking).
basic and communicated in an
unstructured way. The information is
supported by limited evidence and
the relationship to the evidence may
not be clear.
PhysicsAndMathsTutor.com
Question Answer/Indicative content Marks Guidance
AO3.3 Evaluation
0 marks Lexical analysis is necessary to put the
No attempt to answer the question code into a format which can be read and
or response is not worthy of credit. processed (i.e. parsed) by the syntax
analyser.
Examiner’s Comments
Candidates were assessed on the quality
of their extended response in this question.
Many candidates explained the stages of
compilation very well. Some went on to
describe how code from the library
becomes part of the finished program
equally well. Few justified why each stage
was necessary. Many candidates scored
well on this question.
Total 11
PhysicsAndMathsTutor.com