1/21
Looks like no tags are added yet.
What is an Imperative programming paradigm?
Concerned with how a problem should be overcome.
Series of commands specifying what has to be done, and when, to achieve a result.
What is a Declarative programming paradigm?
Concerned with what is required.
Focuses on the end result.
What is Procedural programming?
Example of Imperative programming.
Programs are broken down into key blocks called āproceduresā and āfunctionsā and run as a sequence of steps.
Procedural languages describe which steps to take to solve a problem and how to complete each step.
What is Object Oriented Programming?
Another example of Imperative Programming
In OOP, we represent the solution to a problem through āobjectsā.
Each object has āattributesā that are variables that store information about that object.
It also has methods. Methods are actions an object can carry out.
What is a Method?
A method in OOP is a procedure associated with a class.
A method defines the behaviour of the objects that are created from the class.
A method is an an action an object is able to perform.
e.g Object = Human, Method = Walk
What is a Function?
Combination of instructions that achieve a result.
Function needs inputs and returns results.
What is Functional programming?
Example of Declarative programming.
Functions form the core of the program.
Programs are made up of lines of code consisting of function calls.
e.g C# and Java
What is Logic programming?
An example of Declarative programming.
Programs are based around facts and rules.
Specially designed for fault diagnosis, natural language processing, planning and machine learning.
e.g Prolog
What is Machine language?
Set of instructions executed directly by the CPU.
Each instruction has a specific task (e.g Load)
Consists entirely of binary so difficult to understand.
What are Assembly Languages?
Allows use of mnemonics instead of binary code.
e.g Little Man Computer
An āAssemblerā translates assembly language into machine language.
What are High Level Languages?
e.g Java, Python, C++
All the paradigms covered so far.
User friendly languages.
Similar to human languages.
What is Direct addressing?
Only addressing mode used in LMC.
The operand represent the memory location of the data we want.
In the example if we loaded direct 4 itād load the content stored at Memory Location 4 which in this case is 8 into the accumulator.

What is Immediate Addressing?
The operand is the actual value we want.
In this case if we loaded immediate 4 it would load 4 into the accumulator.

What is Indirect addressing?
The operand is the address of the data we want.
In this case itād go memory location for where it shows 8 is the address of where the content we need is stored. Then 27 is loaded into the accumulator.

What is Indexed addressing?
One of the registers in the CPU is the index register.
The address given is the base address which is then added to the value in the index register.
By incrementing the index register, it is possible to iterate efficiently through an array.
In the example if we load indexed R0 it would put 15 into the accumulator since itās stored at memory location 6 and the index register holds six.
If we loaded indexed R0 when R0 is incremented to contain 1, we would go up to memory location 7 and 32 would be put into the accumulator.

What is Abstraction?
Using abstraction, a programmer hides many of the details about an object and shows only the most relevant information.
This reduces complexity and increases efficiency.
What is Encapsulation?
Methods and attributes of an object are hidden so the object can be used by other parts of a program without it having to reveal itās details.
Keeps the data and the code safe from external interference.
What is Inheritance?
Process by which new classes are created from existing classes and inherit the general characteristic of those classes.
What is Polymorphism?
One name but many forms.
Property of a object can change without the context.
How do you create a class?
The word āclassā followed by name of class.
A list of private attributes
Word āendclassā

What is a Constructor?
New objects are created with constructors. These are procedures with name new. e.g public procedure new()
A constructor is an example of a method.
It is public so it can be accessed outside of the class but is always included within the class.
How do you create a new class and inherit the general characteristic of existing classes?
Denoted by the inherits keyword.
Methods in the original class (superclass) are called with the keyword super.
Constructor method wise this would be super.new()