Programming Languages Flashcards

1
Q

What are the three generations of programming languages?

A

First Generation: Machine code, Second Generation: Assembler, Third Generation: Imperative high level programming languages

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

What does ‘imperative’ mean in the context of high-level programming languages?

A

Command

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

What is a key characteristic of high-level programming languages?

A

Closer to English language, easier to understand

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

What is the role of a translator in high-level programming languages?

A

Converts instructions into code that the computer understands

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

What advantage do high-level programming languages offer regarding processor architecture?

A

Greater portability

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

What is one instruction in high-level programming languages mapped to in machine code?

A

Several machine code instructions

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

What programming constructs do high-level languages support?

A
  • Sequencing
  • Selection
  • Iteration
  • Assignment
  • Functions
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How do declarative programming languages operate?

A

Determine what is to be computed rather than how it is computed

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

Name three examples of declarative high-level programming languages.

A
  • SQL
  • HTML
  • CSS
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What do low-level programming languages refer to?

A

Machine code and assembly language

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

What does ‘low level’ indicate in low-level programming languages?

A

A low level of abstraction

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

What can low-level programming languages control?

A

The hardware of the computer

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

Why are low-level programming languages considered not portable?

A

They depend on the architecture of the processor

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

What are low-level programming languages appropriate for?

A
  • Developing new operating systems
  • Embedded systems
  • Hardware device drivers
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

In what format is machine code expressed?

A

Binary values 0 and 1

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

What is the language that computers understand?

A

Machine code

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

What are the two parts of a machine code instruction?

A
  • Operator
  • Operand
18
Q

What does the processor decode in a machine code instruction?

A

The operator to identify the task to be carried out

19
Q

What does the operand in a machine code instruction represent?

A

The value or memory address that the instruction is to be operated on

20
Q

Fill in the blank: Machine code instructions are made up of the ______ and the operand.

21
Q

Fill in the blank: Machine code is specific to a ______.

23
Q

What does assembly language provide?

A

Basic computer instructions for programs to run

24
Q

What is the relationship between machine code and assembly code?

A

One-to-one relationship; one assembly instruction maps to one machine code instruction

25
Q

How does assembly language differ from machine code in terms of readability?

A

Assembly language uses names (mnemonics), making it easier for programmers to understand

26
Q

What is unique about the instruction set of assembly language?

A

Each type of processor has its own instruction set and assembly language

27
Q

Fill in the blank: Assembly code developed for one processor architecture will not run on _______.

28
Q

What is a sample instruction to load a value in assembly language?

29
Q

What does the instruction ‘MOV a 23’ do?

A

Transfers the number 23 into the variable a

30
Q

What does the instruction ‘ADD 2 3’ do?

A

Adds the two values 2 and 3

31
Q

What is the purpose of the ‘STORE’ instruction?

A

Store data in RAM

32
Q

What is one advantage of low-level languages?

A

Produces better optimized and more efficient code

33
Q

In what scenarios are low-level languages appropriate?

A

Developing new operating systems, embedded systems, and hardware device drivers

34
Q

What is a disadvantage of low-level languages?

A

Very difficult to understand and modify

35
Q

True or False: Assembly code is portable across different computer architectures.

36
Q

Why is writing assembly code time-consuming compared to high-level languages?

A

There is a one-to-one correspondence with machine code and instruction

37
Q

What is a disadvantage regarding the availability of compilers or interpreters for low-level languages?

A

Not always available, particularly for embedded systems

38
Q

How do high-level languages compare to low-level languages in terms of portability?

A

High-level languages are more portable across different computer systems

39
Q

What allows high-level code to be easier to understand?

A

More abstract and closer to natural language

40
Q

Fill in the blank: High-level languages take _______ time to write because a single instruction maps to several machine code instructions.

41
Q

What is one reason low-level code runs slower?

A

Layers of abstraction and inefficiency in the translator