Types of Programming Languages Flashcards
What are Programming Paradigms
Different ways of using a programming language to solve a problem
Describe the Programming Paradigms Diagram
What is an Imperative Programming Paradigm
Uses code that clearly specifies the actions to be performed
What is a Procedural Paradigm
- Easy to write and interpret since it provides traditional data types and data structures
- Written as a sequence of instructions
- Widely-used paradigms as it can be applied to a wide range of problems
What is an Object-Oriented Paradigm
- Based on objects formed from classes which have attributes and methods
- Focuses on making programs that are reusable and easy to update and maintain
- Suited to problems which can be broken into reusable components with similar characteristics
What is a Declarative Programming Paradigm
- States the desired result and the programming language determines how best to obtain the result
- Details about how result is obtained are abstracted from the user
What is a Functional Paradigm
- Functions form the core of the program
- Function calls are often combined within each other
- Closely linked to mathematics
What is a Logic Paradigm
- A set of facts and rules based on the problem is defined
- Queries are used to find answers to problems
What are the four main structures used in structured programming
- Sequence - code is executed line-by-line
- Selection - a certain block of code is run if a specific condition is met
- Iteration - a block of code is executed a certain number of times or while a condition is met
- Recursion - functions are expressed in terms of themselves. Functions are executed, calling themselves, until the base case is reached
What is Assembly Language
- A low level language that uses mneomincs to represent instructions
- Each line in assembly language is equivalent to one line of machine code
- The instruction is divided up into operand and opcode
Describe the List of Mnemonics used in Assembly Language
What is Machine Code split up into
- Opcode - specifies the instruction to be performed and the addressing mode
- Operand - holds a value related to the data on which the instruction is to be performed
What are Addressing Modes
- Addressing Modes specifies how the operand should be interpreted
- Addressing Modes are better because they allow for more address locations to be acessed
What are the four Addressing Modes
- Immediate Addressing - the operand is the actual data upon which the instruction is to be performed
- Direct Addressing - the operand gives the address which holds the value upon which the instruction is to be performed (used in Little Man Computer)
- Indirect Addressing - the operand gives the address of a register which holds another address, where the data is located
- Indexed Addressing - an index register is used, which stores a certain value. The address of the operand is determined by adding the operand to the index register (this is necessary in order to access data stored continguously/ togther in arrays)
What is a class
A template for an object which defines the attributes and methods of the object