1.2.4 Types of programming language Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What is procedural programming?

A

Instructions are given in sequence.
Selection and iteration are used to control what a program does and how many times.
Contain functions and procedures.

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

What is object oriented programming?

A

A programming style which consists of objects that interact with each other.
Objects have attributes and methods.

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

What is assembly language?

A

Mnemonics are used to represent binary, machine code instructions.

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

What is a high level language?

A

A language that is similar to our languages, making it easy for humans to understand and write in.

Must be translated to machine code.

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

What is a low level language?

A

A language which uses instructions linked to the processor. It is harder for humans to use.

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

What is an op code?

A

An instruction in a binary sequence.

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

What is an operand?

A

Data for an instruction to act on.

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

How do you add and subtract in the LMC?

A

ADD

SUB

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

How do you store and load a value from the accumulator to memory and vice versa in the LMC?

A

STA - store value in memory

LDA load value from memory

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

What are the three methods of branching in the little man computer?

A

BRA - branch always

BRP - branch if positive (accumulator value)

BRZ - branch if zero (accumulator value)

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

How do you input and output data in the little man computer?

A

INP - input

OUT - output

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

How do you define a named data location in the LMC?

A

DAT

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

How do you end the LMC program?

A

HLT

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

What is direct addressing?

A

The location given is the address of the data to be used.

e.g. LDA 43 – loads contents of 43

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

What is indirect addressing?

A

The address given holds the address of the data to be used.

e.g. LDA 43, loads contents of address in 43

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

What is indexed addressing?

A

The value given is added to the value stored in the index register to give the memory location.

e.g. if the index register is 100, LDA 43 will load the contents of 143

17
Q

What is immediate addressing?

A

The value given is not an address but the value to be used.

LDA 43, loads 43 into the accumulator.

18
Q

What is a class?

A

A template used to define an object, specifying the attributes and methods and object should have.

19
Q

What is an object?

A

An instance of a class.

20
Q

What is a method?

A

A subroutine associated with an object.

21
Q

What is a constructor?

A

A subroutine which defines how an object is created.

22
Q

What is an attribute?

A

Variables contained within and associated with an object.

23
Q

What does it mean that an attribute is private?

A

It cannot be accessed from outside of the class.

24
Q

What does it mean if a method is public?

A

It can be used by

25
Q

What is encapsulation?

A

Ensuring private attributes can only be changed through public methods. This prevents objects from being manipulated in unintended ways.

26
Q

What is inheritance?

A

The ability for a class to take on methods and attributes from a parent class.

A child class can have its own methods and attributes which override the inherited ones.

27
Q

What is polymorphism?

A

The ability for objects of different classes to be treated in the same way, depending on the properties of that object.

e.g. changing a door colour on a house to blue can be applied to every house as all houses have doors.