Worksheet 4
Worksheet 4
Task 1
1. Insert the following languages into the correct column in the table:
Java, VB, Assembly code, Python, C++, machine code, C#, PHP
VB machine code
Python
C++,
C#
PHP
True or False?
A programming language which has
1. statements resembling English or Maths is T
classified as a high-level language
A high-level language is closer than a low-
2. level language to the machine code that the F
computer can execute
Assembly code does not have to be
3. translated into machine code before it can be T
executed
An interpreter is a program that translates a
4. F
high level language into machine code
A compiler is a program that translates a high
5. T
level language into machine code
There are different assembly languages for
6. T
different processor types
There are different high-level languages for
7. T
different processor types
1
Worksheet 4
Translators and facilities of languages
Unit 8 Logic and languages
Task 2
The Python code below contains a syntax error and a logic error.
2
Worksheet 4
Translators and facilities of languages
Unit 8 Logic and languages
(c) If you have Python installed on your computer, try out the code and see if you are right.
(d) If numItems = 6 is now inserted at line 6, what will happen when the program is run?
nothing
(e) When this error is fixed, does the program give the correct result? If not, correct it.