Types of programming language Flashcards
software and software development
What is a programming paradigm
The approach a programming language takes to define a program.
What are the different common types of high-level paradigms
- Procedural programming
- Object-oriented programming
- Functional programming
- Declarative Programming
What is procedural p[rogramming
A language where instructions are given in sequence.
These can be grouped into subroutines that can be called throughout the program.
What is object-orientated programming
A language in which the solution is represented by objects that interact
What is functional programming
A description of the solution to a problem is built up through a collection of functions, some of which are used to define other functions
What is declarative programming
A language where the characteristics of a solution are stated, rather than stating how the problem is solved
Eg. SQL
How do procedural languages work
We give the compiler instructions on the steps we want it to go through to solve a problem.
- These instructions are given in sequence
- Selection is used to decide what a program does when certain conditions are met
- Iteration (ie. loops) dictates how many times it does it
What are the two types of iteration
- Condition controlled
- Count controlled
What is memory addressing
Different ways of referring to locations.
what does ADD do (LMC)
Add
What does SUB do (LMC)
subtract
What does STA do (LMC)
Stores value from the accumulator to memory
What does LDA do (LMC)
Loads value from the memory to the accumulator
What does BRA do (LMC)
Branch always ( loop continuously)
What does BRZ do
Branch if zero ( loop only if the value in the accumulator is currently 0)
What does BRP do (LMC)
Branch if positive (loop only if the value in the accumulator is currently positive)
what is INP (LMC)
Input
What is OUT (LMC)
Output
What is HLT (LMC)
End program
What is a class
Defines a type of object
- Specifies the methods and attributes an object should have
What is an object
An instance of a class
What is an attribute
Variables contained within and associated with an object
what is a method
A subroutine associated with an object
What is a method
A subroutine associated with an object
What are the 4 pillars of OOP
- Abstraction
- Inheritance
- Polymorphism
- Encapsulation