1.2.4 - Types of Programming Language Flashcards

1
Q

State the four addressing modes.

A

Immediate Addressing.
Direct Addressing.
Indirect Addressing.
Indexed Addressing.

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

In LMC, the STA mnemonic stands for _____. What is the function of this?

A

In LMC, the STA mnemonic stands for “store”.

This stores the value in the accumulator at the given memory address.

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

Identify the four main programming structures used in structured programming.

A

Sequence.
Selection.
Iteration.
Recursion.

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

In LMC, the BRP mnemonic stands for _____. What is the function of this?

A

In LMC, the BRP mnemonic stands for Branch if Positive.

This branch is conditional, given that the value in the accumulator is positive.

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

State an advantage of procedural programming.

A

It can be applied to wide range of problems.

Procedural programming is relatively easy to write and interpret.

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

What are programming paradigms?

A

Programming paradigms are 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
7
Q

In LMC, the BRA mnemonic stands for _____. What is the function of this?

A

In LMC, the BRA mnemonic stands for Branch Always.

This branch is unconditional, and will always branch to the given address.

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

Which two MAIN categories are programming paradigms categorised into?

A

Programming paradigms are split into either:
- Imperative
- Declarative.

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

In LMC, the BRZ mnemonic stands for _____. What is the function of this?

A

In LMC, the BRZ mnemonic stands for Branch if Zero.

This branch is conditional, given that the value in the accumulator is 0.

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

State one use of declarative programming.

A

Expert systems.
Knowledge-based systems.
Artificial Intelligence.

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

How does assembly language differ from machine code?

A

Assembly language uses mnemonics, rather than the standard binary. One line in assembly language is equivalent to one line in machine code.

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

State the function of the opcode and the operand.

A

The opcode specifies the instruction that needs to be performed. The opcode also identifies the addressing mode that needs to be used.

The operand holds the value which is related to the data, on which the instruction is to be performed.

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

Give one disadvantage of object oriented languages. (OOL)

A
  1. OOL require a different style of thinking which can be difficult for programmers to get used to, as they may be accustomed to other paradigms to pick up.
  2. OOP may not be suited to all types of problems.
  3. It isn’t logical to use OOP for small scale problems.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is Encapsulation?

A

Encapsulation is the process of keeping an object’s attributes private so they can only be accessed and changed via public methods

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

What is Polymorphism?

A

Polymorphism means that objects of different types can be treated in the same way

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

What is a programming language?

A

A programming language is a set of commands, instructions and other syntax that is used to create a software program.

17
Q

What is a low level language?

A

A language which is close to machine code. It is related closely to the design of the machine. This can be referred to as a “One to one” language.

18
Q

What is machine code?

A

A set of all possible instructions made available by the hardware design of a particular processor. Machine code is the closest to pure binary?

19
Q

Who created LMC, and when?

A

Dr. Stuart Madnick, in 1965.

(icl you probs don’t need to know this but it was on some sheet that sir gave us)

20
Q

Define a class.

A

A template defining methods and attributes used to make objects

21
Q

Define an object.

A

An instance of a class.

22
Q

Define a base class.

A

Contains the attributes and methods. It is the highest class and doesn’t inherit anything from any other class. (Think of the base class as the main class)

23
Q

What is a superclass?

A

A class that has been extended by another class. It allows the extending class to inherit it’s attributes of the class it extends.

24
Q

What is a subclass?

A

A class that extends another class. The subclass inherits the methods and attributes of the class that it extends.

25
Q

What is a derived class?

A

A derived class is any class that inherits attributes and methods from any other derived class or base class.

26
Q

Define instantiation.

A

The process of creating an actual named instance of class. The instantiated named copy of the class in an object of that class.O

27
Q

What is overriding?

A

A method in a subclass or derived class which has the same name as a method in one or more of it’s superclass’s. The method supersedes all other versions of the other method above it in the inheritance tree. (Mark Scheme Answer [2 Marks]))

28
Q

What is a method?

A

A program routine contained within an object designed to perform a particular task on the data within the object. A method could be a procedure, or a function.

29
Q

State the definition of an attribute.

A

A single bit of data within a record.

30
Q

Define encapsulation.

A

All of the objects attributes are contained and hidden in the object, and access to them is restricted to the operations of that class.

31
Q

Define polymorphism.

A

A specialised form of overloading which allows us to create very general object structures, which can be used with a wide range of data types.

32
Q
A