Skip to content

5.2 Language Translators

AS Level · 2 questions found

  • Need for assembler, compiler and interpreter
  • Benefits and drawbacks of compiler vs interpreter; justify each
  • Partially compiled & partially interpreted languages (e.g. Java)
  • IDE features: context-sensitive prompts, dynamic syntax checks, prettyprint, single stepping, breakpoints
Q3
May/Jun 2024 Paper 1 v1 5 marks
Question 3 — page 1Question 3 — page 2Question 3 — page 3
3 A software developer is writing a computer program. (a) The developer uses an interpreter while writing the program code because it is easier for debugging. Explain one reason why it is easier to debug the program code using an interpreter instead of a compiler. ............................................................................................................................................. [2] (b) The program is ready to be sold to customers. The developer uses a compiler because it creates an executable file. Explain the reasons why the need to create an executable file makes the complier the appropriate choice when the program is complete. ............................................................................................................................................. [3] BLANK PAGE
Show mark scheme
3(a) [2 marks]
1 mark
each to
max 2
:

The interpreter will stop when an error is found

... so the error can be corrected in real-time, and the result of changes
seen immediately

Only one error is displayed at a time

… so fewer errors to correct simultaneously
and
no dependent errors
3(b) [3 marks]
1 mark
each to
max 3
:

Program can be distributed without source code

... so it cannot be edited/stolen/plagiarised

Users do not require the translator to run the program

… so time is not spent retranslating by user
Q8
May/Jun 2024 Paper 1 v2 10 marks
Question 8 — page 1Question 8 — page 2
8 A programmer uses an Integrated Development Environment (IDE) to write a computer program. The IDE has both a compiler and an interpreter as built-in translators. (a) The programmer decides to use the compiler when testing the final program. Describe the benefits of using the compiler during testing. ............................................................................................................................................. [2] (b) IDEs have many features other than built-in translators. Complete the table by identifying one other common IDE feature that can be used for each purpose. Describe how each feature helps the user during program development. Each feature must be different. Do not give translator as one of your features. Purpose IDE feature Description for coding for presentation for debugging [6] Permission to reproduce items where third-party owned material protected by copyright is included has been sought and cleared where possible. Every reasonable effort has been made by the publisher (UCLES) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the publisher will be pleased to make amends at the earliest possible opportunity. To avoid the issue of disclosure of answer-related information to candidates, all copyright acknowledgements are reproduced online in the Cambridge Assessment International Education Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download at www.cambridgeinternational.org after the live examination series. Cambridge Assessment International Education is part of Cambridge Assessment. Cambridge Assessment is the brand name of the University of Cambridge (c) The programmer uses program libraries when developing the program. Describe two benefits to the programmer of using program libraries. 1 ................................................................................................................................................ 2 ................................................................................................................................................ [2]
Show mark scheme
8(a) [2 marks]
1 mark
each to
max 2
:

Creates an executable file

… so the code can be tested multiple times without having to recompile

… so
repeated testing
takes less time
8(b) [6 marks]
1 mark
for identification of each feature and
1 mark
for matching description:
e.g.
For coding:
IDE feature
Description
Context-sensitive
Gives suggestions
for code as the user
prompts
types instead of having to write/remember
the code
Auto
-correct
Corrects spelling mistakes so that user has
fewer errors to correct
For presentation:
IDE feature
Description
Pretty-printing
Colour code keywords so the user can
identify any errors
Expand/collapse (code)
The user can hide code that they are not
blocks
currently working on
For debugging:
IDE feature
Description
Single stepping
Run the code
one line at a time
// shows
the effect of each line of code
Breakpoints
Stop the code running at a set point to
check the flow/variable contents
8(c) [2 marks]
1 mark
each to
max 2
:

Saves programming/testing time as code does not have to be written/re-
written from scratch // code does not have to be tested

Code is already tested so it is more robust/likely to work

The programmer does not need to maintain the library // library routines
are updated automatically

Can perform complex calculations that the programmer may be unable to
do

Makes code more easily readable