Programming Languages Flashcards

(40 cards)

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 ______.

22
Q

What does assembly language provide?

A

Basic computer instructions for programs to run

23
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

24
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

25
What is unique about the instruction set of assembly language?
Each type of processor has its own instruction set and assembly language
26
Fill in the blank: Assembly code developed for one processor architecture will not run on _______.
another
27
What is a sample instruction to load a value in assembly language?
LOAD #23
28
What does the instruction 'MOV a 23' do?
Transfers the number 23 into the variable a
29
What does the instruction 'ADD 2 3' do?
Adds the two values 2 and 3
30
What is the purpose of the 'STORE' instruction?
Store data in RAM
31
What is one advantage of low-level languages?
Produces better optimized and more efficient code
32
In what scenarios are low-level languages appropriate?
Developing new operating systems, embedded systems, and hardware device drivers
33
What is a disadvantage of low-level languages?
Very difficult to understand and modify
34
True or False: Assembly code is portable across different computer architectures.
False
35
Why is writing assembly code time-consuming compared to high-level languages?
There is a one-to-one correspondence with machine code and instruction
36
What is a disadvantage regarding the availability of compilers or interpreters for low-level languages?
Not always available, particularly for embedded systems
37
How do high-level languages compare to low-level languages in terms of portability?
High-level languages are more portable across different computer systems
38
What allows high-level code to be easier to understand?
More abstract and closer to natural language
39
Fill in the blank: High-level languages take _______ time to write because a single instruction maps to several machine code instructions.
less
40
What is one reason low-level code runs slower?
Layers of abstraction and inefficiency in the translator