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 two 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/ knowledge-based systems
  • Artificial Intelligence
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Identify the four 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 differ from machine code?

A

Assembly language uses mnemonics rather than binary. One line in assembly language is equal to one line of 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 - 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

Opcode - specifies the instruction to be performed and the addressing mode
Operand - holds a value related to 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 four addressing modes.

A
  • Indexed addressing
  • Indirect addressing
  • Immediate addressing
  • Direct addressing
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is a class?

A

The template for an object that defines the state and behaviour of an object - 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 OOP.

A
  • Requires a different style of thinking which can be difficult for programmers accustomed to other paradigms to pick up
  • May not be suited to all types of problems
  • Generally unsuitable for smaller problems
How well did you know this?
1
Not at all
2
3
4
5
Perfectly