1.2.4 Types Of Programming Language Flashcards
1
Q
Programming paradigms
A
- are different approaches to using a programming language to solve a problem
- can be imperative or declarative
2
Q
Imperative languages/programming
A
- uses code that clearly specifies the actions to be performed step by step
- uses statements that change a programs state e.g in the form of sequence selection etc
3
Q
Declarative programming
A
- states the desired result and the programming language determines best how to obtain the result
- eg. Functional programming
4
Q
Procedural programming/language
A
- an imperative paradigm
- breaks a solution down into subroutines
- programs are written as a sequence of instructions to be executed
- instructions are excecuted in a step by step manner
- are easy to write and interpret
5
Q
Assembly language
A
- Low level mnemonic representation of machine code that is computer architecture/processor specific
- uses mnemonics which are abbreviations/ sequences of letters that are easy to remember e.g ADD for addition [1]
- each line in assembly language is equivalent to one line of machine code
6
Q
Modes of addressing
A
- machine code instructions are made up of an opcode and operand
- addressing mode specifies how the operand should be interpreted
7
Q
Opcode
A
- is part of the instruction and indicates what to do (as well as the addressing mode)
8
Q
4 modes of addressing
A
- immediate addressing
- direct addressing
- indirect addressing
- indexed addressing
9
Q
Immediate addressing
A
- the operand is the actual value upon which the instruction is performed
- the operand is part of the instruction
10
Q
Direct addressing
A
- the value of the operand is a reference to the address in memory where the required value is located
11
Q
Indirect addressing
A
- the operand gives the address of a register which holds another address where the data is located
12
Q
Indexed addressing
A
- an index register is used which stores a certain value.
- The address of where the data is located is determined by adding the operand to the contents of the index register
- used to access data stored contiguously in memory eg. In arrays
13
Q
Why are addressing modes used?
A
- addressing modes allow for a much greater number of locations for data to be stored in, as the size of the operand would otherwise limit the number of addresses that could be accessed
14
Q
Class
A
- acts as a blueprint/template for creating objects with specific attributes and methods [1]
- classes provide a way to organise code in a modular way [1]
15
Q
Object
A
- a particular instance of a class with its own unique values and properties