types of programming language

studied byStudied by 6 people
0.0(0)
Get a hint
Hint

what are programming paradigms?

1 / 40

41 Terms

1

what are programming paradigms?

  • different approaches to using a programming language to solve a problem

  • split into two broad categories (imperative/declarative) which can be broken down into more specific paradigms

New cards
2

what is imperative programming?

programming where the code clearly specifies the actions to be performed

New cards
3

what is declarative programming?

  • programming where the code 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

New cards
4

what is functional programming?

  • a declarative paradigm

  • functions form the core of the program

  • function calls are often combined within each other

  • closely linked to mathematics

New cards
5

what is logical programming?

  • a declarative paradigm

  • a set of facts and rules based on the problem are defined

  • queries are used to find answers to problems

New cards
6

what is procedural programming?

  • a widely-used imperative paradigm as it can be applied to a wide range of problems

  • written as a sequence of instructions

  • easy to write and interpret

  • instructions are carried out in a step-by-step manner

New cards
7

what are the features of a procedural language?

  • written as a sequence of instructions

  • provide traditional data types and data structures

  • simple to implement and applicable to most problems

  • not possible to solve all kinds of problems or may be inefficient to do so

  • structured programming is a popular subsection of procedural programming in which the control flow is given by four main programming structures:

    • sequence, selection, iteration and recursion

New cards
8

what is assembly language?

  • low level language that is the next level up from machine code

  • uses mnemonics, which are abbreviations for machine code instructions

  • commands used are processor-specific

  • each line in assembly language is roughly equivalent to one line of machine code

New cards
9

what is the function of the LMC command ADD?

add the value at the given memory address to the value in the accumulator

New cards
10

what is the function of the LMC command SUB?

subtract the value at the given memory address from the value in the accumulator

New cards
11

what is the function of the LMC command STA?

store the value in the accumulator at the given memory address

New cards
12

what is the function of the LMC command LDA?

load the value at the given memory address into the accumulator

New cards
13

what is the function of the LMC command INP?

allows the user to input a value which will be held in the accumulator

New cards
14

what is the function of the LMC command OUT?

prints the value currently held in the accumulator

New cards
15

what is the function of the LMC command DAT?

creates a flag with a label at which data is stored

New cards
16

what is the function of the LMC command BRZ?

branches to a given address if the value in the accumulator is zero (conditional branch)

New cards
17

what is the function of the LMC command BRP?

branches to a given address if the value in the accumulator is positive (conditional branch)

New cards
18

what is the function of the LMC command BRA?

branches to a given address no matter the value in the accumulator (unconditional branch)

New cards
19

name the two parts of a machine code instruction.

opcode and operand

New cards
20

what is the opcode?

the part of an instruction that specifies the instruction to be performed and the addressing mode

New cards
21

what is the operand?

the part of an instruction that holds a value related to the data on which the instruction is to be performed

New cards
22

what does an addressing mode specify?

specifies how the operand should be interpreted

New cards
23

what is immediate addressing?

the operand is the actual value upon which the instruction is to be performed

New cards
24

what is direct addressing?

the operand gives the address which holds the value upon which the instruction is to be performed

New cards
25

what is indirect addressing?

the operand gives the address of a register which holds another address, where the data is located

New cards
26

what is indexed addressing?

an index register is used, which stores a certain value. the address of the data is determined by adding the operand to the value in the index register

New cards
27

what is object oriented programming?

an imperative paradigm based on objects formed from classes which have attributes and methods

  • suited to problems which can be broken into reusable components with similar characteristics

  • focuses on making programs that are reusable and easy to update and maintain

New cards
28

what is a class?

  • a template for an object that defines the state and behaviour of an object

  • classes can be used to create objects by a process called instantiation

New cards
29

what is an object?

a particular instance of a class

New cards
30

what is a setter?

a method that sets the value of a particular attribute

New cards
31

what is a getter?

a method which retrieves the value of a given attribute

New cards
32

what is inheritance?

  • the process in which a subclass inherits all of the methods and attributes of the superclass

  • subclass can also have its own additional properties

New cards
33

what is a superclass?

  • a class from which many subclasses can be created

  • the subclasses inherit the methods and attributes of a superclass through inheritance

New cards
34

what is a subclass?

  • a class that is derived from a superclass

  • it can have new functionality, such as new attributes or methods

  • it inherits the methods and attributes of a superclass through inheritance

New cards
35

what is polymorphism?

an attribute of object oriented programming that enables objects to behave differently depending on their class

New cards
36

what is overloading?

  • a form of polymorphism

  • the methods are distinguished by passing in different parameters (different frequency or data type) into a method

New cards
37

what is overriding?

  • a form of polymorphism

  • the method is redefined in the subclass so that it functions differently and produces a different output (but has the same name and parameters as the method in the superclass)

  • if the function is called within the superclass it will function as it was initially defined

New cards
38

what is encapsulation?

  • used to hide the values or internal state of an object, preventing direct access from unauthorised parties

  • encapsulated attributes of an object should only be accessible/changeable by the public methods provided

New cards
39

why do programmers use encapsulation?

it keeps data related to an object safe so it can't be accidentally altered elsewhere in the code

New cards
40

what are the benefits of using object oriented programming?

  • high level of reusability

  • code made more reliable through encapsulation

  • makes code easy to maintain and update

  • classes can be reused as a black box which saves time and effort

New cards
41

what are the drawbacks of using object oriented programming?

  • requires an alternative style of thinking

  • not suited to all types of problems

  • generally unsuitable for smaller problems

New cards

Explore top notes

note Note
studied byStudied by 37 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 50 people
Updated ... ago
5.0 Stars(3)
note Note
studied byStudied by 59666 people
Updated ... ago
4.9 Stars(331)
note Note
studied byStudied by 10 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 16 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 5 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 79 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 26 people
Updated ... ago
5.0 Stars(2)

Explore top flashcards

flashcards Flashcard282 terms
studied byStudied by 42 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard100 terms
studied byStudied by 15 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard44 terms
studied byStudied by 1 person
Updated ... ago
5.0 Stars(1)
flashcards Flashcard243 terms
studied byStudied by 88 people
Updated ... ago
5.0 Stars(3)
flashcards Flashcard23 terms
studied byStudied by 6 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard66 terms
studied byStudied by 26 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard22 terms
studied byStudied by 7 people
Updated ... ago
5.0 Stars(2)
flashcards Flashcard79 terms
studied byStudied by 14 people
Updated ... ago
5.0 Stars(1)