Paper 1 Definitions Flashcards

1
Q

Advantages of Subroutines (5)

A
  • reduced amount of repeated code
  • can concentrate on error fixing certain parts of the code at a time
  • multiple programmers can work on the project at once
  • once a function is finished the variables are deleted from memory so not so much memory is needed to run the program
  • can use recursive methods e.g. sorting data
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Process of Stack Frames (9)

A
  • when a routine is called the computer allocated memory in a specialised region of memory called the ‘stack’
  • every time a procedure is called by another procedure, a new stack frame for the procedure is pushed onto the stack
  • stack frames contain copies of local variables in the parameters section
  • the return address’ (variable’s) memory location is stored in the stack frame
  • the stack frame stores the routine’s parameters and local variables until the routine ends
  • when the routine ends:
    • the value is stored to the return address
    • control is passed back to the main function
    • the stack frame is removed from the stack
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

2 Types of Programming Paradigms
- types
- descriptions
- examples

A

Imperative
- “we use instructions to say how to get the output we want”
- Procedural Programming: use subroutines, selection, sequence, iteration
- Object Orientated Programming: use objects and classes

Declarative Programming
- “we say what we want”
- Functional Programming

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

Advantages of OOP (6)

A
  • data is protected by encapsulation
  • an object can be changed without needing to change the objects that interact with it (improved software maintainability)
  • class code is reusable
  • improved software stability and consistency
  • lower cost of development
  • higher quality software
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Disadvantages of OOP (5)

A
  • harder to produce efficiently
  • approach is not suited for all applications
  • larger program size
  • slower program execution due to increased instruction base
  • can be difficult to apply over wide variety of applications
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Class (definition)

A
  • a group of objects with the same attributes and methods
  • a blueprint to describe how the data type works
  • an object definition
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Instantiation (definition) (+ what happens)

A

The process of making an instance of an object
- usual for a constructor to run when an object is created
- this will set the values for the attributes of the object

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Encapsulation is applied if (3)

A
  • you need to prevent change to an object from external objects
  • the internal complexity is not needed by other object and doesn’t affect their states
  • (objects can communicate together but their implementation details are hidden from one another)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Multiple Inheritance (2)

A
  • occurs when a class inherits from more than one parent
  • gives more power to an OOP language as many base classes can be set up from which subclasses gain properties
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Aggregation (definition)

A

A relationship between objects/classes where an object/class contains other objects/classes
- “has a” association between objects/classes
- lifecycle of the two objects/classes is independent
- - both exist in their own right (if one deleted the other still remains)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Composition (definition)

A

A relationship between objects/classes where an object/class contains other objects/classes
- “a part of” association between objects/classes
- life cycle of the object/class is dependent on the other object/class that contains it
- - if you remove the parent object/class then all child objects/classes are removed

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

Polymorphism (definition)

A

The ability of a programming language to process objects differently depending on their data type/class
- the ability of a method to exhibit different behaviours depending on the object on which the method is invoked
- allows different classes to be used with the same interface

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Hash Table (definition)

A

Data structure that creates a mapping between keys and values

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Dictionary (definition) (data type)

A
  • a dictionary is a collection of key value pairs in which the value is associated via the associated key
  • abstract data type
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Convex Combination of Two Vectors

A
  • finds a way to calculate points that lie on a line between 2 points
  • 𝛂u + ꞵv where
    • u and v are vectors
    • 𝛂 + ꞵ = 1
    • 𝛂 and ꞵ are >= 0
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Procedural Abstraction (definition)

A

Represents a computational method
Actual values are replaced by parameters

16
Q

Functional Abstraction (definition)

A

Hiding computational methods from the rest of the solution

17
Q

Data Abstraction

A

A data object, e.g. a stack, hides the details of how the data is actually represented, e.g. the use of arrays and pointers, allowing the user to know how to use it and not on how it is constructed

18
Q

“Backus Naur form does … “
“BNF can … “
“All regular languages can …”

A
  • “Backus Naur form does not support iteration. It uses recursion instead”
  • “All regular languages can be represented using a finite state machine without outputs”
  • “BNF can represent some language that are not regular”
  • e.g. palindromes, strings that have brackets of arbitrary depth
19
Q

Turing Machines (3)

A
  • An abstract concept of a machine capable of carrying out any computable algorithm
  • A number, sequence or algorithm is computable if and only if a Turing machine can be described which is capable of computing it
  • Any task that can be computed by any computer can be computed by a Turing machine
20
Q

A UTM can be considered to be an interpreter as:

A
  • it reads instructions one at a time
  • and executes these instructions
  • instructions are stored on the tape
21
Q

Abstraction by Generalisation (definition)

A

Grouping of common characteristics

22
Q

Information Hiding

A

Hiding the details of an object that does not contribute to its essential characteristics

23
Q

Problem Abstraction

A

Details are removed until the problem is represented in a way that is possible to solve because the problem reduces to one that has already been solved