SLR 3 - Programming paradigms Flashcards
What is a paradigm?
a way of thinking
What are the three different types of programming language? + examples
- procedural (Pascal, Python, c)
- object orientated (C++, Java)
- assembly
What is Turing complete?
A computing language which is able to solve all problems a computer is able to solve.
What do procedural languages entail?
- instructions
- sequence, selection and iteration
- interaction
- procedures and functions
What do object orientated languages entail?
- objects are modelled on real world
- objects interact
- inheritance
What do assembly languages languages entail?
- mnemonics
- processor specific
What does a class diagram look like?
- a rounded rectangle separated into 3 sections
- section 1 = class name
- section 2 = attributes
- section 3 = methods
What is instantiation? e.g.,
the process of creating an object from a class template
e.g., person1 = new Person(“Dylan”, “Cheese”)
What key word links to the constructor?
- ‘new’
- this will be in you class code and runs when an object of this class type is created
What is inheritance?
- Reuses and extends code from the original class within a new one
- It uses the attributes and methods from the previous class but can contain additional attributes and methods.
What are the classes called during inheritance?
- the original class becomes the superclass
- the calls which inherits is called the subclass
What does ‘.super’ do?
Overrides the inheritance and takes the value in the attribute from the superclass
What is the key piece of code that needs to go into the subclass when its created?
class employee ‘inherits’ person