Handout Prog Langs
Handout Prog Langs
Orientation
Machine/
Problem
Not/User
Friendly
Memory
Requirment
High/Low
Execution
Fast/Slow
Examples
________________________________________________________________________
________________________________________________________________________
1|Page
6. Tick in the space provided showing which of these programs are Machine (Computer)
Oriented or Portable.
7. What are Mnemonics and in which generation level are these used.
________________________________________________________________________
________________________________________________________________________
2|Page
10. What do the following terms refer to:
Machine/object code:______________________________________________________
Source Code: _____________________________________________________________
Executable Code: _________________________________________________________
Byte Code: ______________________________________________________________
11. What extensions are usually associated with these file types:
Machine/object code:__________________
13. 4th Generation Languages are more user-friendly because they are Interactive,
Integrated and Modular. Expain the terms in bold.
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
3|Page
14. What do you understand by object-oriented programming?
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
16. Why do High Level Languages have to be translated to machine code in order for these
to be processed?
________________________________________________________________________
________________________________________________________________________
17. Complete the following table by stating whether the following are qualities of an
interpreter or compliler.
Statement Translator
Programs using this type of translator run faster
Translates and executes the source code line by line
Produces executable code which is stored in a separate file.
When using this translator the program is translated every
time the program is run
Beginners in programming often find this translater more
useful.
This translator is used once most errors have been cleared.
4|Page
18. Use ten of the following terms to complete the passage below:
1GL 2GL 3GL 4GL 5GL
assembler compiler interpreter executed translated
high middle low slow faster
source object bytecode computer portable
interpreted compiled platforms Assembly debugger
Java is a specialized _____. This means it is a _____ level language, widely used
in Internet-related software. It is a/an _______________ language meaning that the
lines of code are _______________ line-by-line – a _____ process.
The Java program that is written by the programmer is called the
__________________ code, depicted by the .java extension. The
__________________ does not directly understand Java, so a Java program has to
be ________________ first into __________________ (or ______________ code)
by a _________________ to create a .class file. When the program is run, every
line of this .class file is then _______________ and _______________, line after
line on a virtual machine.
Unlike a _____ level language such as __________________ language, a Java
program is __________________, meanings that it can be compiled to run on a
variety of processors and _______________.
19. Instructions are divided into two parts, the Function Code, usually known as the
______________ and the Address Code, also known as the ______________. The whole
instructions can be referred to as the ___________________. A number of instructions
is called an ____________________.
5|Page
20. Consider the following routine written in assembly language. A semicolon
indicates a comment:
LDA 1 ; load 1 into the accumulator
STA N ; store the contents of the accumulator in location N
LDA 5 ; load 5 into the accumulator
STA C ; store the contents of the accumulator in location C
Loop: LDA N ; load the contents of location N into the accumulator
MUL C ; multiply the contents of the accumulator by the contents of location C
STA N ; store the contents of the accumulator in location N
LDA C ; load the contents of location C into the accumulator
DEC ; decrement the contents of the accumulator
STA C ; store the contents of the accumulator in location C
JNZ loop ; jump to LOOP if the contents of the accumulator are not zero
RET ; stop
___________________________________________________________________
___________________________________________________________________
___________________________________________________________________
___________________________________________________________________
6|Page
22. Consider the following section of an assembly language
(iii) Suppose that initially 1 is stored in location X. Write down the contents of
X and N as they change when this code is being executed.
_______________________________________________________________
_______________________________________________________________
_______________________________________________________________
_______________________________________________________________
_______________________________________________________________
_______________________________________________________________
_______________________________________________________________
(iv) Hence (as a consequence) what are the contents of X after execution?
_______________________________________________________________
7|Page