Skip to the worksheet
Revision Library
Choose a subject

Translators and Integrated Development Environments (IDEs) - Worksheets, Questions and Revision

15 original exam-style questions - 5 pages of questions with a full mark scheme - free printable PDF.

Grades 1-9

This topic is chapter 8 of GCSE Computer Science Topic Workbook 2 and chapter 17 of GCSE Computer Science 10-Minute Tests.

Revision Library
revisionlibrary.co.uk
GCSE · Computer Science

2.10 Translators and Integrated Development Environments (IDEs)

OCR J277 · Calculators not allowed · about 65 minutes
Total Marks
Name: _______________________________    Date: ____ / ____ / ______
Answer ALL questions. Show all your working.
1
State two features of high-level languages that make them different from low-level languages.
(Total for Question 1 is 2 marks)
2
State two features of low-level languages (such as assembly language or machine code).
(Total for Question 2 is 2 marks)
3
Programs can be written in either a high-level or a low-level language.
(a)State one advantage of writing a program in a high-level language rather than a low-level language.(2)
(b)State one advantage of writing a program in a low-level language rather than a high-level language.(2)
(Total for Question 3 is 4 marks)
4
Explain why assembly language uses mnemonics (short text codes such as ADD or JMP) instead of pure binary machine code.
(Total for Question 4 is 3 marks)
5
Explain how an interpreter translates and executes a program, including what happens if it reaches a line containing a syntax error.
(Total for Question 5 is 4 marks)
6
A company is developing firmware for a low-cost embedded thermostat. The firmware must run as fast as possible on very limited memory, and will be mass-produced and never modified once installed. State which type of translator should be used and give two reasons for your choice.
(Total for Question 6 is 3 marks)
7
Explain how a breakpoint helps a programmer to debug a program.
(Total for Question 7 is 3 marks)
8
Explain how single-stepping through code (running the program one line at a time) helps a programmer to debug it.
(Total for Question 8 is 2 marks)
9
A junior programmer keeps forgetting to close brackets and does not indent the inside of loops consistently, making the code hard to read. Identify two IDE tools that would help and explain how each one addresses the problem.
(Total for Question 9 is 4 marks)
10
A software company is deciding whether to develop a new mobile game using a compiler or an interpreter. Explain the key differences between compilers and interpreters, and discuss which would be more appropriate for this mobile game, justifying your answer.
(Total for Question 10 is 6 marks)
11
An Integrated Development Environment (IDE) is a piece of software that provides tools to help a programmer write, test and debug programs.
(a)Which IDE tool shows different types of code element (e.g. keywords, strings, comments) in different colours, to make code easier to read?(1)
  • A) Auto-complete
  • B) Syntax highlighting
  • C) Breakpoint
  • D) Run-time environment
(b)Which IDE tool automatically suggests the rest of a keyword, variable or function name as the programmer types, to save time and reduce spelling mistakes?(1)
  • A) Auto-complete
  • B) Error diagnostics
  • C) Translator
  • D) Debugger
(c)Which IDE tool checks code for syntax errors as it is typed, underlining and reporting the location and type of any errors found?(1)
  • A) Auto-complete
  • B) Error diagnostics
  • C) Breakpoint
  • D) Refactoring tool
(d)Which IDE tool lets a programmer run a program from within the IDE, without needing separate software, so it can be tested immediately?(1)
  • A) Run-time environment
  • B) Version control
  • C) Auto-indentation
  • D) Stepping
(Total for Question 11 is 4 marks)
12
Discuss how IDE tools support a programmer while developing and testing a large program, referring to at least three different IDE tools in your answer.
(Total for Question 12 is 6 marks)
13
Two important translators used when developing software are compilers and interpreters.
(a)Define what is meant by a compiler.(2)
(b)Define what is meant by an interpreter.(2)
(Total for Question 13 is 4 marks)
14
State three differences between compilers and interpreters.
(Total for Question 14 is 6 marks)
15
Explain one benefit of a code refactoring tool built into an IDE.
(Total for Question 15 is 2 marks)
Mark scheme · 2.10 Translators and Integrated Development Environments (IDEs)

Question 1

  • one valid distinguishing feature, e.g. readable English-like statements; portability across processor architectures; greater abstraction from hardware; one statement can represent several machine-code instructions; higher-level data structures, oeB1
  • a second, different valid feature, oeB1
  • Answer: Any two distinct features, e.g. readable English-like statements; portability across processors; greater abstraction from hardware; one statement can represent several machine-code instructions.

Question 2

  • written in binary (machine code) or using short mnemonics (assembly language) that closely correspond to individual processor instructions, oeB1
  • tied to a specific type of processor - a program is generally not portable between different processor types without rewriting, oeB1
  • Answer: Low-level languages closely match individual processor instructions (using binary or mnemonics) and are tied to a specific processor type.

Question 3

  • (a) easier/quicker for a programmer to write and understand, since the syntax is closer to natural English, oeB1
  • (a) more portable - the same source code can often be compiled/run on different types of computer with little or no change, oeB1
  • (a) Answer: It is easier and quicker to write and understand, and is more portable across different types of computer.
  • (b) runs faster/more efficiently, since it does not need to be translated into a less direct set of instructions, oeB1
  • (b) gives the programmer precise control over exactly how the hardware/memory is used, which matters for embedded systems or maximum performance, oeB1
  • (b) Answer: It runs faster/more efficiently and gives the programmer precise control over the hardware.

Question 4

  • mnemonics are short, memorable text abbreviations for machine code operations, oeB1
  • they are far easier for a programmer to read, write and remember than long strings of binary digits, oeB1
  • this reduces the chance of a programmer making an error, while each mnemonic still maps directly to one machine instruction, so precise control over the hardware is kept, oeB1
  • Answer: Mnemonics are short, memorable abbreviations that are much easier to read and write than binary, reducing errors, while each still maps directly to one machine instruction.

Question 5

  • the interpreter translates and executes the source code one line/statement at a time, oeB1
  • each line is checked and run before the next line is translated, oeB1
  • if a line contains an error, the interpreter stops immediately at that line and reports the error, oeB1
  • any lines already executed before the error was reached will already have had their effect, but no executable file is produced/saved, oeB1
  • Answer: The interpreter translates and runs each line in turn; if it reaches a line with an error it stops immediately and reports it, and no executable file is ever saved.

Question 6

  • compiler, caoB1
  • because compiling produces a standalone executable that runs directly/fast without needing the translator present, which suits a device with very limited memory, oeB1
  • and because compiling happens once during development, so the slower/more thorough translation process does not affect how fast the finished device runs, oeB1
  • Answer: A compiler, because it produces a fast, standalone executable that does not need the translator present, and the one-off translation cost does not affect the device's running speed.

Question 7

  • a breakpoint is a marker placed on a specific line of code that pauses execution of the program when that line is reached, oeB1
  • this lets the programmer inspect the current values of variables at that exact point in the program, oeB1
  • which helps them find the point at which a variable's value first becomes incorrect, narrowing down where a logic error is occurring, oeB1
  • Answer: A breakpoint pauses the program at a chosen line so the programmer can inspect variable values at that point, helping to narrow down where a logic error occurs.

Question 8

  • it lets the programmer watch exactly what the program does, and how variable values change, one instruction at a time, oeB1
  • this makes it easier to see precisely which line causes a value to become wrong, rather than only seeing the final incorrect output, oeB1
  • Answer: Single-stepping lets the programmer watch each instruction execute and see exactly when a variable's value first becomes wrong.

Question 9

  • one suitable IDE tool, e.g. auto-indentation/code formatting; bracket matching/syntax highlighting; automatic bracket completion; error diagnostics, oeB1
  • a linked explanation of how that tool corrects inconsistent indentation or helps identify/prevent an unclosed bracket, oeB1
  • a second, different suitable IDE tool, oeB1
  • a linked explanation of how that second tool addresses a stated problem, oeB1
  • Answer: For example: auto-indentation or code formatting keeps loop bodies consistently indented; bracket matching, automatic bracket completion or error diagnostics helps identify or prevent unclosed brackets. Accept two suitable tools with matching explanations.

Question 10

  • Level 1 Basic, undeveloped comments about compilers and/or interpreters are given, with little or no reference to the mobile game scenario. Little relevant technical terminology is used.1-2
  • Level 2 At least one genuine difference between compilers and interpreters is explained with some understanding, and a choice is made for the mobile game, but the justification may be one-sided or lack detail in places. Relevant technical terminology is generally used correctly.3-4
  • Level 3 A well-balanced discussion clearly explains multiple differences between compilers and interpreters (e.g. speed, error reporting, distribution) and reaches a justified, well-supported conclusion for the mobile game scenario. Relevant technical terminology is used correctly throughout.5-6
  • Indicative content:
    • A compiler translates the whole program before it is run, producing a standalone executable; an interpreter translates and executes line by line and needs the interpreter present every time the program runs
    • Compiled programs generally run faster/more efficiently, which matters for a real-time mobile game that needs smooth performance
    • Compiling produces one distributable file that does not expose the readable source code, which also helps protect the company's work from being copied
    • A compiler reports all syntax errors together before anything runs, so a fully tested, compiled game is less likely to crash from small errors once released
    • An interpreter can be useful earlier in development, for testing small sections of code quickly, but this matters less for the final released product
    • A justified conclusion should recommend a compiler for the finished, released mobile game, since running speed and having a single protected executable matter more than line-by-line testing at this stage

Question 11

  • (a) B caoB1
  • (a) Answer: B) Syntax highlighting
  • (b) A caoB1
  • (b) Answer: A) Auto-complete
  • (c) B caoB1
  • (c) Answer: B) Error diagnostics
  • (d) A caoB1
  • (d) Answer: A) Run-time environment

Question 12

  • Level 1 One or two IDE tools are named, with little or no explanation of how they help. Little relevant technical terminology is used.1-2
  • Level 2 At least two IDE tools are named and explained with some understanding of how each helps a programmer, but the discussion may lack detail or fail to link the tools together.3-4
  • Level 3 Three or more IDE tools are clearly named and explained (e.g. from editing, error-checking and debugging categories), with a coherent discussion of how, together, they reduce development time and the number of errors in a large program. Relevant technical terminology is used correctly throughout.5-6
  • Indicative content:
    • A source code editor with syntax highlighting, auto-indentation and auto-complete helps a programmer write code faster and with fewer typing mistakes
    • Error diagnostics/real-time syntax checking catches mistakes as they are typed, before the program is even run
    • A built-in run-time environment lets the programmer test the program immediately, without needing separate software
    • Breakpoints, single-stepping and variable/watch windows let a programmer pause execution and inspect variable values, helping locate the exact point a logic error occurs
    • Refactoring tools let a programmer safely restructure code (e.g. renaming a variable everywhere it is used) across a large program without missing an occurrence
    • Together, these tools reduce development time and the number of errors that reach the finished program, which matters more as a program becomes large and complex

Question 13

  • (a) a compiler is a translator that converts the whole of a high-level source code program into object/machine code, oeB1
  • (a) ...before the program is run, producing a standalone executable file, oeB1
  • (a) Answer: A compiler translates the whole of a high-level program into object/machine code before it is run, producing a standalone executable file.
  • (b) an interpreter is a translator that translates and executes a high-level source code program, oeB1
  • (b) ...one line/statement at a time, without producing a saved executable file, oeB1
  • (b) Answer: An interpreter translates and executes a program one line at a time, without producing a saved executable file.

Question 14

  • a compiler translates the whole program at once; an interpreter translates it line by line, oeB1
  • a compiler produces a saved executable (object code) file; an interpreter does not produce a saved executable file, oeB1
  • once compiled, a program can be run without the original source code or the compiler present; an interpreter (or the source code) is needed every time an interpreted program is run, oeB1
  • a compiled program generally runs faster, since translation only happens once; an interpreted program generally runs slower, because translation happens every time it is run, oeB1
  • a compiler reports all syntax errors together at the end of translation; an interpreter stops as soon as it reaches the first error, oeB1
  • nothing runs until a compiled program successfully compiles in full; an interpreted program can often be tested and debugged incrementally, one line at a time, oeB1
  • Answer: Compilers translate the whole program at once into a saved, faster-running executable and report all errors together; interpreters translate and run line by line, need no saved executable, run slower, and stop at the first error.

Question 15

  • a refactoring tool automatically applies structural changes to code (e.g. renaming a variable everywhere it is used, or extracting repeated code into a subroutine), oeB1
  • this saves time and reduces the risk of the programmer missing an occurrence and introducing a new error when making the same change by hand, oeB1
  • Answer: A refactoring tool automatically applies a structural change (e.g. a rename) everywhere it is needed, saving time and avoiding missed occurrences that a manual change could introduce.

Mark your answers

Check answers without an account. Some answers can be checked automatically; use the mark scheme to mark the rest.

Question 1

2 marks
Did your answer earn the marks?

Question 2

2 marks
Did your answer earn the marks?

Question 3

4 marks
Did your answer earn the marks?

Question 4

3 marks
Did your answer earn the marks?

Question 5

4 marks
Did your answer earn the marks?

Question 6

3 marks
Did your answer earn the marks?

Question 7

3 marks
Did your answer earn the marks?

Question 8

2 marks
Did your answer earn the marks?

Question 9

4 marks
Did your answer earn the marks?

Question 10

6 marks
Did your answer earn the marks?

Question 11(a)

1 mark
Choose an answer

Question 11(b)

1 mark
Choose an answer

Question 11(c)

1 mark
Choose an answer

Question 11(d)

1 mark
Choose an answer

Question 12

6 marks
Did your answer earn the marks?

Question 13

4 marks
Did your answer earn the marks?

Question 14

6 marks
Did your answer earn the marks?

Question 15

2 marks
Did your answer earn the marks?
Mark my answers

Worksheets are written for Revision Library and come with a full mark scheme; a few English packs quote an out-of-copyright text, and name it on the page. Exam board names and specification codes say which qualification a pack suits: we are not affiliated with, endorsed by or approved by any exam board, and no past-paper question is reproduced here. Rights queries: hello@revisionlibrary.co.uk