Computer Science – 2210
(Test # )
Date : Name :
1 Programmers can use a high-level language to write a computer program.
(a) Explain what is meant by the term ‘high-level language’.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................... [2]
(b) A program written in a high-level language is translated into machine code. This is so that it
can be processed by a computer.
Name one type of translator that can be used.
.............................................................................................................................................. [1]
(c) Describe how your answer to part (b) translates this program.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
.............................................................................................................................................. [3]
2 Look at these two pieces of code:
A: CLC B: FOR Loop = 1 TO 4
LDX #0 INPUT Number1, Number2
loop: LDA A,X Sum = Number1 + Number2
ADC B,X PRINT Sum
STA C,X NEXT
INX
CPX #16
BNE loop
(a) Which of these pieces of code is written in a high-level language?
[1]
(b) Give one benefit of writing code in a high-level language.
[1]
(c) Give one benefit of writing code in a low-level language.
[1]
(d) High-level languages can be compiled or interpreted.
Give two differences between a compiler and an interpreter.
[2]
8 Dimitri is writing a computer program in a high-level language.
He needs to send just the machine code for the program to his friend, electronically.
It is important that the program is executed as quickly as possible.
Identify which translator will be most suitable for Dimitri to use. Explain your choice.
Type of translator .............................................................................................................................
Explanation ......................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
[4]