1.2.4 - Types of Programming Language Flashcards
State the four addressing modes.
Immediate Addressing.
Direct Addressing.
Indirect Addressing.
Indexed Addressing.
In LMC, the STA mnemonic stands for _____. What is the function of this?
In LMC, the STA mnemonic stands for “store”.
This stores the value in the accumulator at the given memory address.
Identify the four main programming structures used in structured programming.
Sequence.
Selection.
Iteration.
Recursion.
In LMC, the BRP mnemonic stands for _____. What is the function of this?
In LMC, the BRP mnemonic stands for Branch if Positive.
This branch is conditional, given that the value in the accumulator is positive.
State an advantage of procedural programming.
It can be applied to wide range of problems.
Procedural programming is relatively easy to write and interpret.
What are programming paradigms?
Programming paradigms are different approaches to using a programming language to solve a problem.
In LMC, the BRA mnemonic stands for _____. What is the function of this?
In LMC, the BRA mnemonic stands for Branch Always.
This branch is unconditional, and will always branch to the given address.
Which two MAIN categories are programming paradigms categorised into?
Programming paradigms are split into either:
- Imperative
- Declarative.
In LMC, the BRZ mnemonic stands for _____. What is the function of this?
In LMC, the BRZ mnemonic stands for Branch if Zero.
This branch is conditional, given that the value in the accumulator is 0.
State one use of declarative programming.
Expert systems.
Knowledge-based systems.
Artificial Intelligence.
How does assembly language differ from machine code?
Assembly language uses mnemonics, rather than the standard binary. One line in assembly language is equivalent to one line in machine code.
State the function of the opcode and the operand.
The opcode specifies the instruction that needs to be performed. The opcode also identifies the addressing mode that needs to be used.
The operand holds the value which is related to the data, on which the instruction is to be performed.
Give one disadvantage of object oriented languages. (OOL)
- OOL require a different style of thinking which can be difficult for programmers to get used to, as they may be accustomed to other paradigms to pick up.
- OOP may not be suited to all types of problems.
- It isn’t logical to use OOP for small scale problems.
What is Encapsulation?
Encapsulation is the process of keeping an object’s attributes private so they can only be accessed and changed via public methods
What is Polymorphism?
Polymorphism means that objects of different types can be treated in the same way