A program where instructions are
given in sequence; selection is
used to decide what a program
does and iteration dictates how
many times it does it
Programs are broken into key blocks
called procedures and functions
Logic
programming
A problem is expressed as
a set of facts and rules
These are used to
find a given goal
Functional programming
Takes in value(s)
and returns a value
Imperative
Giving orders
Assembly Language
(Little Man Computer
(LMC))
Low level language
Memory Adressing
Indirect
The operand is the address of the data wanted
Direct
The operand represents the memory location of the data we want
Immediate
The operand is the actual value we want
Indexed
One of the registers in the CPU is the
index register. This is used for index
addressing. In index addressing the
address giving is the base address. This
is then added to the value in the index
register. By incrementing the index
register, it is possible to iterate
efficiently through an array
Object Orientated Programming
Polymorphism
When methods behave differently according
to the context in which they are used
An example of this is when we have a polymorphic
array that contains objects of different classes but
that inherits from the same super class
Encapsulation
Is the pattern of making attributes in a class
private but allowing them to be changed and
accessed through public methods
Private means that the method or
attribute following it is only
accessible from within that class
Classes & objects
A class is a template
used to create objects
It defines what attributes and
methods an object should have
An attribute is a value, stored in
a variable attached to that object
A method is a subroutine that defines
actions that an object can perform
Inheritance
Allows a class to have all the methods
and attributes of another class
The subclass can also have its
own methods and attributes
The subclass can override
methods of the superclass