Chhetri AcademyGCSE & A level Paper Builder

2.5.1Languages and translators

OCR GCSE Computer Science (J277) · Algorithms and programming (Paper 2) › Programming languages and IDEs

Practise Languages and translators. 12 exam-style questions on this subtopic, at up to four difficulty levels, with full mark schemes and a progress tracker. Free, no account needed.

Build a paper on this topic

▶ Watch videos on Languages and translators (Craig 'n' Dave OCR on YouTube) · Practise all of Programming languages and IDEs

Sample questions

Written for this site in the style of OCR exam questions. They are not taken from real past papers.

Question 1Easy4 marks
(a) Which statement describes a high-level language?
Tick (✓) one box.[1]
  • It uses English-like keywords and is easy for humans to read
  • It is written in binary codes that the CPU executes directly
  • Each instruction matches exactly one machine code instruction
  • It can only be used on one type of processor
(b) Name two types of low-level language.[2]
(c) State the purpose of a translator.[1]
Show the answer and mark scheme
(a) Answer: It uses English-like keywords and is easy for humans to read
(b)
  • machine code
  • assembly language
(c)
  • to convert source code (written in a high-level or assembly language) into machine code that the CPU can execute
Question 2Medium5 marks
(a) Explain two reasons why most programs are written in high-level languages.[4]
(b) Give one reason why a programmer might choose to write code in a low-level language.[1]
Show the answer and mark scheme
(a)
  • they use English-like keywords, so they are easier to read / write / understand
  • so programs are written more quickly / with fewer errors
  • they are not specific to one type of processor (portable)
  • so the same code can be translated to run on different computers
  • one statement can do the job of many machine code instructions
  • so programs are shorter
(b)
  • gives direct control of the hardware / produces code that runs quickly and uses little memory (e.g. for an embedded system or a device driver)
Question 3Hard6 marks
A company is writing a game that it will sell to customers. During development the programmers want to find and fix errors quickly. The company does not want customers to be able to see or copy its source code.
Compare the use of a compiler and an interpreter for this company. You should explain which translator is more suitable at each stage and justify your choices.[6]
Show the answer and mark scheme
  • an interpreter is suitable during development because code can be run straight away, without translating the whole program
  • an interpreter stops at the line with the error, making errors easy to locate
  • sections of code can be tested as soon as they are written
  • a compiler is suitable for the version sold to customers because it produces an executable file
  • customers are not given the source code, so it cannot easily be seen or copied
  • the compiled game runs faster because it is already translated (important for a game)
  • customers do not need to install a translator
  • a compiler reports errors only after translating the whole program, which is less convenient while developing

Related subtopics

Stuck? Get 1-to-1 help. Chhetri Academy tutors GCSE and A level Maths and Science online, with a free 30-minute trial lesson.

Book a free trial