1.2.4 types of programming language Flashcards

1
Q

what are programming paradigms?

A

different approaches to using a programming language to solve a problem

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

which 2 broad categories are programming paradigms split into?

A

imperative, declarative

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

state the advantages of procedural programming

A

can be applied to a wide range of problems, relatively easy to write and interpret

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

state a use of declarative programming

A

expert systems, artificial intelligence

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

identify the 4 main structures used in structured programming

A

sequence, selection, iteration, recursion

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

how does assembly language different from machine code?

A

assembly language uses mnemonics rather than binary, one line in assembly language is equal to one line in machine code

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

What is the function of the STA mnemonic?

A

storing the value in the accumulator at the given memory address

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

what is the function of the BRP mnemonic?

A

branches to a given address if the value in the accumulator is positive, it is a conditional branch

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

state the function of the opcode and operand

A

the opcode specifies the instructions to be performed and the addressing mode. the operand holds a value which is related to the data on which the instruction is to be performed

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

state the 4 addressing modes

A

immediate addressing, direct addressing, indirect addressing, indexed addressing

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

what is a class?

A

a template for an object that defines the state and behaviour of an object is an instance of a class

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

give one disadvantage of object oriented languages

A

requires a different style of thinking which can be difficult for programmers accustomed to other paradigms to pick up, OOP may not be suited to all types if programs, generally unsuitable for smaller problems

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