Levels of Language, Translators and IDE Flashcards

1
Q

What are the 3 types of language a computer uses?

A

Machine code
Low-level language (Assembly code)
High-level language (Source code)

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

What are the 2 tools used to write and convert the language on a computer?

A

Translators

IDEs

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

What is machine code?

A

An instruction that can run inside a CPU and is in binary

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

What is assembly language called?

A

Low level language because it is almost the same as machine code

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

What is the instruction set of a CPU?

A

The complete set of commands available. Each type of CPU has its own instruction set

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

What are mnemonics?

A

The instructions within an assembly language, as they are much easier to remember than a binary number

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

What does assembly language consist of?

A

A set of mnemonic instructions, each of which has a machine code equivalent

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

Give an example of a machine code, followed by a mnemonic code

A

Machine Code - 2403

Mnemonic Code - ADD AL,3

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

Why is programming in assembly language difficult?

A

The programmer needs to know a lot about the hardware details inside the CPU

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

What is the disadvantage with writing in assembly code?

A

The code only works on a specific CPU family, so if you use a different CPU, you need to rewrite the code using a different version of assembly language

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

What is the main advantage with writing in assembly code?

A

Programs in Assembly run much faster compared to programs written in a high level language, because there is less code overall

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

Give an example of a program that is typically written in assembly

A

Device driver, used to directly control hardware such as a graphics card

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

Why were high level languages developed?

A

In order to make programming a lot easier for people, compared to coding in assembly language

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

What 2 main features does high level language have?

A

It has a set of keywords such as PRINT or IF

It has a set of grammar rules (syntax) which define how to combine them correctly

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

What does a programmer write in?

A

Source code (programming code) using the allowed set of keywords and its syntax rules

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

Give 2 examples of high level language code

A

Python

Java

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

What does machine-independent mean?

A

Programs written in high level language can be ported to different computers and still run

18
Q

What does source code need to be converted into in order to run on the CPU?

A

Machine code

19
Q

What piece of software converts source code to machine code?

A

Translator

20
Q

What are the 3 different types of translator?

A

Assembler
Compiler
Interpreter

21
Q

What does the assembler do?

A

It converts assembly code into machine code.

22
Q

What does the complier do?

A

It converts convert programs written in a high-level language into machine code instructions, and then stores it in an executable file

23
Q

What does the interpreter do?

A

It converts a single line of high level source code into machine code and then immediately runs it on the CPU

24
Q

How does the complier translate code?

A

It reads all the source code in one go, examining each keyword and their arguments. It translates those keywords into a set of machine code instructions. The compiler will also check the code for basic syntax errors, and notify the user if it finds any

25
Q

What is the linker?

A

The software that combines object files

26
Q

What is an object file?

A

Sometimes a large program is broken down into several software modules. Each module is compiled into an object file which has machine code

27
Q

How does the interpreter translate code?

A

It translates a single line of source code and then immediately carries out the resulting machine code instructions. Then it reads the next line of source code and does the same. It carries on doing this until the program is terminated

28
Q

Why is the interpreter a bit slower than the complier?

A

Because of the source code -> translate -> run loop

29
Q

What is the advantage with an interpreter?

A

It is excellent for developing and testing code as any errors show up immediately

30
Q

What is the disadvantage with an interpreter?

A

The interpreter must always be present to run the source code. And the source code itself also needs to be available

31
Q

What does IDE stand for?

A

Integrated Development Environment

32
Q

What does an IDE do?

A

Brings all the tools necessary for coding into one application. The tools are designed to work seamlessly together

33
Q

What are 8 typical features of an IDE?

A
Editor
Project(s) explorer
Asset library
Runtime Environment
Object Viewer
Debug tools
Translator
Output Screen
34
Q

What does the editor do?

A

Help you to write code efficiently and easily with aids such as colour coded highlighting, auto-completion and brace matching

35
Q

What is the project explorer?

A

A window that shows project files and folders

36
Q

What is the asset library?

A

A window that lists all the assets such as images, sound, media files in the project

37
Q

What is the runtime environment?

A

It allows you to build the project from its files, compile it all and then run it as if the code was running on the target CPU

38
Q

What is the object viewer?

A

Many languages allow you to create ‘objects’ visually, and these objects have ‘attributes’ or properties that you can view and alter from this window

39
Q

What are the debug tools?

A

These allow you to spot and correct programming errors

40
Q

What is the translator?

A

This is either a built-in compiler or a built-in interpreter depending on the language

41
Q

What is the output screen?

A

The runtime environment includes an output screen that lets you see what the program is showing to the user as it runs