1.2.4 Types of Programming Languages Flashcards

1
Q

What are programming paradims?

A
  • Different approaches to using a programming language to solve a problem .
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the two broad catagories of programming paradims?

A
  • Imperative
  • Declarative
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is an imperative programming paradims?

A
  • Use code that clearly specifies the actions to be
    performed .
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the types of imperative programming paradigms?

A
  • Procedural
  • Object-oriented
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is a procedural programming paradigmn?

A
  • Uses a sequence of
    instructions which may be contained within procedures.
  • These instructions are carried out in a step-by-step manner .
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are the advantages of procedural programming paradigmn?

A
  • Applied to a wide range of problems
  • Easy to write and interpret
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is Object-Oriented programming (OOP) paradigmn?

A
  • Built on entities called objects formed from classes which have
    certain attributes and methods .
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Advantages of Object Orriented programming ?

A
  • Designs code that is resuable
  • Easy to update and maintain
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is a declaritive programming paradigmn?

A
  • Focuses on stating the desired
    result rather than the exact series of instructions that need to be performed to get to the result.
  • To determine how best to obtain the
    result
  • Details about how it is obtained are abstracted from the user .
  • Common in expert systems and artificial intelligence
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are the types of declaritive programming paradigms?

A
  • Functional
  • Logic
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is functional programming?

A
  • Uses the concept of reusing a set of functions.
  • Programs are made up of lines of code consisting of function calls.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is logic programming paradigms?

A
  • Use code which defines a set of facts and rules based on the problem.
  • Queries are used to find answers to problems.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are the features of a procedural language?

A
  • Sequencing
  • Selection
  • Iteration
  • Recursion
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is assembely language?

A
  • The next level up from machine code
    and is part of a family of low level languages.
  • Converted to machine code using an assembler when it is executed.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Features of assembly language

A
  • Uses mnemonics rather than binary,
    which makes it easier to use than direct machine code.
  • Each mnemonic is represented by a numeric code .
  • Commands that assembly language uses are processor-specific.
  • This allows for direct interaction with
    hardware so is useful in embedded systems.
  • Each instruction in assembly language is equivalent to almost one line of
    machine code.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is machine code made up of?

A

Operand and Opcode

17
Q

What is opcode?

A
  • The opcode specifies the instruction to be performed from the commands table
18
Q

What is operand?

A
  • The operand holds a value
    which is related to the data on which the instruction is to be performed.
  • May hold the actual value on which the instruction is to be executed but more often, it holds an address related to where this data is stored.
19
Q

What are adressing modes?

A
  • Specifies how the operand should be interpreted
  • Part of the opcode
  • Allow for a much greater number of locations for data to be stored as
    the size of the operand would otherwise constrain the number of addresses that could be accessed.
20
Q

What are the four types of addressing modes?

A
  • Immediate Addressing
  • Direct addressing
  • Indirect addressing
  • Indexed addressing
21
Q

What is immediate addressing?

A
  • The operand is the actual value upon which the instruction is to be performed, represented in binary
22
Q

What is direct addressing?

A
  • The operand gives the address which holds the value upon which the
    instruction is to be performed. Direct addressing is used in LMC.
23
Q

What is Indirect Addressing?

A
  • The operand gives the address of a register which holds another address, where the data is located .
24
Q

What is indexed addressing?

A
  • 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 to add an offset in order to access data stored contiguously in memory such as in arrays .
25
Q

What are the features of Object Oriented Programming?

A
  • Classes
  • Objects
  • Methods
  • Attributes
  • Inheritence
  • Encapsulation
  • Polymorphism
26
Q

What are classes?

A
  • A class is a template for an
    object and defines the state and behaviour of an object.
27
Q

What are objects?

A
  • An object is a particular instance of a class.
28
Q

What are methods?

A
  • Dunctions associated with objects or classes
  • Define the behaviour and actions that objects can perform
29
Q

What are attributes?

A
  • Give an objects its properties
30
Q

What is inheritence?

A
  • The subclass (derived class) will possess all of the methods and
    attributes of the superclass (parent class)
  • Can have its own additional properties
  • Allows programmers to effectively reuse certain components and properties while making some changes .
31
Q

What is encapsulation?

A
  • Atrributes cannot be directly accessed and edited by users
32
Q

What is polymorphism?

A
  • A property of OOP that means objects can behave differently depending
    on their class .
33
Q

What are the types of polymorphism

A
  • Overriding
  • Overloading
34
Q

What is overriding polymorphism?

A
  • Overriding is redefining a method within a subclass and altering the code so that it functions differently and produces a different output .
35
Q

What is overloading polymorphism?

A
  • Passing in different parameters into a method.
36
Q

What are the advantages of OOP?

A
  • High level of reusability thanks to inheritance and polymorphism.
  • Encapsulation makes the code more reliable by prtecting attributes from being directly accessed
  • OOP requires advances planning resulting in higher quality products
  • Modular structure makes it easy to maintain and update
  • High level of abstraction allowing for classes to be used a s black box once created
37
Q

What is a getter?

A
  • Special method used in OOP to retrieve the value of a given attribute
38
Q

What is a setter?

A
  • Special method used in OOP that sets the value of a particular attribute