What is a programming paradigm?
Programming paradigms are established conventions and practices that dictate how computer programs are structured and developed.
Define a low-level language
A low-level language is a type of computer language that is closely aligned with the basic instructions that a computer’s hardware understands.
What are the features of low-level languages?
Define a high-level language
A high-level programming language is a programming language that uses English-like words, making it easier for humans to read, write and understand.
What are the features of high-level languages?
Describe procedural programming languages
Languages that carry out code a sequence of instructions step-by-step and organise code into reusable blocks (procedures) which perform specific tasks.
What are the advantages of procedural programming languages?
What are the disadvantages of procedural programming languages?
How are procedural languages used?
They are commonly used for software development, data processing and teaching programming fundamentals as they emphasise logical structure and modular design.
Describe object oriented programming languages
They organise code around objects, which combine data (attributes) and behaviour (methods) into reusable units.
Describe how classes are used in Object Oriented programming Languages
Classes are templates from which objects are created. They define both attributes and methods.
How do you define a class in Python?
e.g.
class Dog:
def __init__(self, name,
breed, height, weight):
self.name = name
self.breed = breed
self.height = height
self.weight = weight
self.__variable is used to indicate that the variable is private
What is the difference between private and public attributes and methods?
If an attribute/method is public it can be called by a class. If it’s private it can only be called by the current class.
What is a getter?
A method which retrieves the value of a given attribute
What is a setter?
A method that sets the value of a given attribute
Describe how Encapsulation is used in Object Oriented Programming Languages
Classes can be encapsulated by making attributes private and providing public access methods. This allows for the private attributes to only be able to be edited by public methods. This allows data to be protected.
Describe how get and set methods are used to access private attributes
Getters and setters are used to make sure attributes can’t be directly accessed and edited by users.
What is a constructor?
It allows a new object to be created
Describe inheritance in Object Oriented programming
It enables a child class to be created which can reuse or extend the classes of the parent class. This promotes the reuse of code.
Describe polymorphism in Object Oriented Programming
It means that objects can behave differently depending on their class. This can result in the same methods producing different outputs.
Describe overriding as a form of polymorphism
Redefining a method within a subclass and altering the code so that it functions differently and produces a different output.
Describe overloading as a form of polymorphism
Passing different parameters into a method.
What are the advantages of Object Oriented Programming?
-It has an advantage in security as encapsulation protects attributes from being directly accessed.
-It is efficient as classes can be reused and inherit from one another.
-The separation of components into classes make programs easy to update and maintain
-It is flexible due to polymorphism
What are the disadvantages of Object Oriented programming?