1.2.4 - types of programming language Flashcards

11

1
Q

class

A

A template defining methods and attributes used to make objects.

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

attribute

A

Data associated with the class.

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

method

A

A functionality of the class - something that it can do, or that can be done with it.

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

Why are attributes declared private and methods public?

A

Allows other classes to use methods belonging to another class but may not see or change their attributes.

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

information hiding

A

A class cannot directly access the attributes of another class when they are declared private.

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

constructor method

A

Used to create objects in a class.

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

instantiation

A

The creation of a new object (an instance of a class).

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

getter method

A

Functions that return the value of an attribute.

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

setter method

A

Procedures which change the state of an object.

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

encapsulation

A

Binds together the attributes and methods that manipulate the data.

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

inheritance

A

Classes can inherit data and behaviour from a parent class.

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

synonym for child class

A

subclass

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

synonym for parent class

A

superclass

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

polymorphism

A

A programming language’s ability to process objects differently depending on their class.

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

overriding

A

Defining a method with the same name and formal argument types as a method inherited
from a superclass.

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

opcode

A

Part of the instruction that indicates what to do.

17
Q

mnemonic

A

A sequence of letters that is easy for a person to remember.

18
Q

3 advantages of encapsulation

A
  • reduces the chance of errors/ inconsistencies
  • ensures objects can only be changed in the way intended
  • protecting data
19
Q

BRP

A

branch if zero or positive

20
Q

Describe 2 benefits of using an object-oriented paradigm rather than a procedural paradigm.

A
  • Code can easily be reused as classes can be used in other programs.
  • Code can be more secure as access to attributes can be restricted via methods.
21
Q

declarative language

A

A high-level language that states what is required but not how to do it. The statements do not have to be in a specific order.

22
Q

State and explain one use of a declarative language. (2)

A

medical diagnosis: can find alternative solutions

23
Q

Describe 3 features of an object-oriented language. (6)

A
  • Self-contained object contains methods and attributes
  • Uses encapsulation so the object can only be accessed through methods
  • Inheritance allows a subclass to derive attributes and methods from its superclass