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

A3 Solutions – Programming languages

Uploaded by

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

A3 Solutions – Programming languages

Uploaded by

Dowuona Joel
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

KS4 - Programming Learner worksheet

Lesson 1 - Translators

Programming languages: Solutions


Introduction
These questions have been designed to check your understanding of high-level and low-
level languages, with attention to translators.

You will need:


● Activity 2 ‘Lost in translation’ handout

Q1 Match the definition to the description:

Page 1 Last updated: 14-05-21


KS4 - Programming Learner handout
Lesson 1 - Translators

Q2 Write example code for each language listed below:

(Note for the assessor: A learner could write many variations here, but there should
be key characteristics for each example given)

Machine code 0011001100100

Assembly language mov edx,DWORD PTR [rbp-0x4]

Any high-level int c=a+b;


language

Q3 If a program written in assembly language uses 400 lines of code, how many lines of
machine code will there be?

Answer: 400

Q4 What is needed in order to translate assembly language to machine code?

Answer: An assembler

Q5 Machine code is specific to the CPU/Central Processing Unit/Processor (fill in the


blank)

Q6 Who first conceived the idea of a compiler?

Answer: Grace Hopper

Q7 List three reasons why high-level languages are more suitable for programmers than
low-level languages?

Reason 1 Easier to read/write

Reason 2 Easier to maintain

Reason 3 Easier to debug

Q8 Why are translators necessary?

Page 2 Last updated: 14-05-21


KS4 - Programming Learner handout
Lesson 1 - Translators

Translators convert high-level languages into machine code. Computers can only
understand machine code, so translators were needed so that programmers could write
using high-level languages which could still be understood by computers after
translation.

Q9 Compare and contrast compilers to interpreters.

A compiler creates an executable file that can then be used independently of the original
source code.

An interpreter translates and executes each line of code during runtime, the interpreter
is always required for the code to run.

Once code has been compiled, it can be run quickly because it requires no further
translation.

An interpreter translates during runtime which can slow down the process.

An executable file created by a compiler can easily be shared with other users.

The source code and the interpreter are required to run code translated by an
interpreter. This means that other users will need these before they can run the
program.

Explorer task

Create a mind map of all the key terms listed on the ‘Lost in translation’ handout.

Resources are updated regularly — the latest version is available at: ncce.io/tcc.

This resource is licensed under the Open Government Licence, version 3. For more information on this
licence, see ncce.io/ogl.

Page 3 Last updated: 14-05-21

You might also like