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

What are the 2 broad catagories which programming paradigms are split into?

A
  • imperative - declarative
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are 2 advantages of procedural programming?

A
  1. can be applied to a wide range of problems 2. relatively easy to write and interpret
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Whate are 2 uses of declarative programming?

A
  1. expert systems 2. ai
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the 4 main structures used in structured programming?

A
  1. sequence 2. selection 3. iteration 4. recursion
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How does assembly language differ from machine code? (2 things)

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

to store 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? (2 things)

A
  1. to branch to a given address if the value in the accumulator is positive 2. it is a conditional branch
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the function of the opcode? (2 things)

A
  • to specify the instruction to be performed and the addressing mode - the operand holds a value, 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

What are the 4 addressing modes?

A

direct addressing indirect addressing indexed addressing immediate addressing

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

What is a class? (2 things)

A
  • a template for an object that defines the state and behaviour of an object - on object is an instance of a class
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are 2 disadvantages of object orientated languages?

A
  1. requires a different style of thinking, which can be difficult for programmers accustomed to other paradigms to pick up 2. generally unsuitable for smaller problems
How well did you know this?
1
Not at all
2
3
4
5
Perfectly