1.2.4 - Types of Programming Language Flashcards

1
Q

What does a class do?(3)

A

Classes can be encapsulated(1).Make attributes private.(1) Provide public acess methods.(1)

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

What is inheritence?(3)

A

When a class takes on the methods (1) and attributes (1) of a parent class(1)

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

What is meant by an assembler?(2)

A

A program that translates assembly code(1) into machine code (1)

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

What is meant by a class?(2)

A

A template (1) defining methods and attributes (1)

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

What is a high-level language? (1)

A

A programming language that is close to “normal” english making it easy to understand and read - eg. Python

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

What is a low-level language? (1)

A

A programming language that is close to binary making it harder to understand and read - eg. Assembly code

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

Give 3 advantages of assembly language. (3)

A

It has the same efficiency of execution (due to its one-to-one nature). (1) It produces very precise and optimised/efficient code. (1) It provides direct access to system-level features without having to go through a software interface (improving the speed). (1)

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

Give 3 disadvantages of assembly language. (3)

A

It is machine-dependant and very hard to port. (1) The code is very hard to write / is very prone to bugs. (1) The code is very hard to understand (making it hard to modify and maintain). (1)

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

What is object-oriented programming? (2)

A

OOP involve solutions being constructed by means of objects that interact with each other. (1) OOP uses classes as templates to construct objects. (1)

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

What is procedural programming? (2)

A

Procedural programming breaks a solutiondown into subroutines. (1) These subroutinesare re-built and combined to form a program. (1)

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

What is the program structure of procedural programming? (1)

A

It uses procedures and functions.

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

What is the program structure of object-oriented programming? (1)

A

It uses classes and methods.

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

What are the fundamental programming constructs of procedural programming? (3)

A

It uses: sequencing (1) branching (1) and iteration (1)

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

What do the assembly mneumonics: ADD & SUB mean? (2)

A

ADD = add. (1) SUB = subtract. (1)

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

What do the assembly mneumonics: STA & LDA mean? (2)

A

STA = store. (1) LDA = load. (1)

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

What do the assembly mneumonics: INP & OUT mean? (2)

A

INP = input. (1) OUT = output. (1)

17
Q

What do the assembly mneumonics: HLT & DAT mean? (2)

A

HLT = end program. (1) DAT = data location. (1)

18
Q

What do the assembly mneumonics: BRA & BRZ & BRP mean? (2)

A

BRA = branch always. (1) BRZ = branch if zero. (1) BRP = branch if positive (or zero). (1)

19
Q

What is instantiation? (2)

A

The process of creating an object (1) from a class template (1)

20
Q

What is polymorphism? (1)

A

Polymorphism is a programming languages ability to process objects differently based on their class

21
Q

What is encapsulation? (2)

A

The process of keeping an object’s attributes private (1) so they can only be accessed and changed via public methods. (1)

22
Q

Describe the advantages of using encapsulation. (3)

A

It reduces the chance of errors/inconsistences. (1) It ensures objects can only be changed in the way intended. (1) It protects data/data can’t be accidentally changed. (1)

23
Q

What are the 4 types of addressing? (4)

A

Immediate addressing. (1) Direct addressing. (1) Indirect addressing. (1) Index addressing. (1)

24
Q

What is immediate addressing? (1)

A

The operand is the value to be used.

25
Q

What is direct addressing? (1)

A

The operand is the memory location that holds the data to be used.

26
Q

What is indirect addressing? (1)

A

The operand is the memory location that is holding the memory location of the data to be used.

27
Q

What is indexed addressing? (1)

A

The operand is added to the contents of the index register to get the memory location of the data to be used.