Languages And Translators Flashcards

1
Q

What are the 2 low level languages you are expected to know?

A

Machine code and Assembley language

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is low level language

A

A low level language is close to the processor

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a high level language

A

Written using English like words and are platform dependant

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are a few examples of a high level language

A

C, C++, Java, Visual Basic, JavaScript, Perl, Python, Ruby, SQL, MatLab, HTML, Mercury, OPS5, and Prolog

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is first generation language and an example of one

A

Languages interpreted directly by the processor e.g. machine code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is second generation language and an example of one

A

Used in Kernels and hardware drives e.g. Assembly language

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is second generation language and an example of one

A

Used in Kernels and hardware drives e.g. Assembly language

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is third generation languages and an example of one

A

These are imperative(step by step instructions) languages e.g. C, C++, Java, Visual Basic and Javascript

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is fourth generation language and an example of one

A

These consist of statements that are more like statements in the human language e.g. Perl, Python, Ruby, SQL, MatLab and HTML

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is fifth generation language and an example of one

A

These have visual tools to develop a program e.g. Mercury, OPS5 and Prolog

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is machine code

A

A language consisting of binary or hexadecimal instructions which a computer can respond to directly

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is assembly language

A

A symbolic code, using mnemonics that is platform specific

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Name a pro and a con of using Machine code

A

Pros
Programs run quick
Programmer interfacing directly with the processor and has more control

Cons
Long winded
Error prone
Not portable between processors
Hard to debug
Detailed knowledge required

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Name a pro and a con of using assembly language

A

Pro
Easier than machine code and take less mem than high level languages
Programmer directly interacting with registers, more control

Cons
Code is difficult to read than high level
Detailed knowledge required
Machine dependant, not portable without modification

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Name a pro and a con of using high level language (HLLs)

A

Pros
Uses English language like keywords, therefore easy to understand
Platform independent
No knowledge of hardware required

Cons
Programmer must rely on the compiler to optimise the code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What are the three translators

A

Assembler
Compiler
Interpreter

17
Q

What does a translator do

A

It produces machine code from a source

18
Q

What is a compiler

A

Translates the whole source program into machine code in one pass

19
Q

Name a pro and a con of using a compiler

A

Pros
Once source code has been compiled you no longer need the compiler or source code
Customer does not need to buy a compiler
Programmer does not need to distribute their source

Cons
Debugging code will be slower than using an interpreter
The object code will only run on the processor type it was originally compiled for

20
Q

What is an interpreter

A

Translates each line and immediately performs the required action before translating the next line

21
Q

Name a pro and a con of using an interpreter

A

Pros
Programmer gets immediate feedback while they are developing

Cons
Same section/line of code may be translated over and over, complied programs would run faster
Programmer needs to distribute their source, and customer needs to install an interpreter

22
Q

What is an assembler

A

Takes basic computer instructions and converts them into a pattern of bits that the computers processor can use to perform basic operations

23
Q

What is bytecode

A

An instruction set, used for programming, that can be executed on any computer which has a virtual machine installed. Usually the source is compiled to bytecode then bytecode is interpreted