Programming Languages Flashcards

1
Q

What is a programming language?

A

A programming language is a set of words or symbols which allows humans to give instructions to computers

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

What is a computer programme?

A

Computer programmes are a list of instructions a CPU can use to carry out a particular task

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

What is the Computer Language Hierarchy?

A

High Level Language -> Assembly language -> Machine Code (binary/hexadecimal)

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

Why is assembly language important?

A

It allows programmer to talk directly to the computer without using binary

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

Can a computer directly read anything not in machine code?

A

No, all computer programmes must end up as machine code

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

What is a Low Level Language?

A

A language that can directly interact with computer hardware

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

Why does low level and high level mean?

A

It refers to the level of abstraction.

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

Why would you use low level languages?

A

1) They refer to actual memory locations and have direct access to the processor. 2) Instructions are executed faster, so the speed of processing the programme increases. 3) They use less memory

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

Are assembly languages and machine code low or high level languages?

A

They both are low level languages

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

How is assembly language written?

A

With mnemonics, e.g. INT, SUB 5 or LDA

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

What is a mnemonic?

A

Processor-specific abbreviated text commands, each of which translate to one machine code instruction

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

Why do we use high level languages?

A

The programmer does not need knowledge of hardware or the instruction set, so they can focus on the problem they are solving. It is easier and faster to write, understand, change and debug code as high level languages use english-like statements. Produces portable code - can be used on different computers

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

What is the difference between an interpreter and a compiler?

A

An interpreter converts instructions line-by-line, but a compiler converts all the instructions at once

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

What are the advantages of using a compiler over an interpreter?

A

Once the instructions have been compiled, you don’t need the compiler anymore - no compiler needed on the user’s computer. Interpreters are always needed to run. It’s slower. It can optimise the whole programme

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

What are the advantages of using an interpreter over a compiler?

A

Compilers take a long time to start up. End user can’t see the source code. It’s easier to debug

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

What is an assembler?

A

It converts assembly code into machine code.

17
Q

What is the compiled file called?

A

An executable