Types of Programming Language Flashcards
What are programming paradigms?
Different approaches to using a programming language to solve a problem.
Which two broad categories are programming paradigms split into?
- Imperative
- Declarative
State the advantages of procedural programming.
- Can be applied to a wide range of problems
- Relatively easy to write and interpret
State a use of declarative programming.
- Expert systems/ knowledge-based systems
- Artificial Intelligence
Identify the four main structures used in structured programming.
- Sequence
- Selection
- Iteration
- Recursion
How does assembly language differ from machine code?
Assembly language uses mnemonics rather than binary. One line in assembly language is equal to one line of machine code.
What is the function of the STA mnemonic?
Storing the value in the accumulator at the given memory address.
What is the function of the BRP mnemonic?
Branches to a given address if the value in the accumulator is positive - conditional branch.
State the function of the opcode and operand.
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
State four addressing modes.
- Indexed addressing
- Indirect addressing
- Immediate addressing
- Direct addressing
What is a class?
The template for an object that defines the state and behaviour of an object - an instance of a class.
Give one disadvantage of OOP.
- 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