Types of programming languages - paper 1 Flashcards

1
Q

What are the two types of programming paradigms?

A

Imperative and declerative

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

What is imperative programming?

A

Uses code that clearly specifies the actions to be performed e.g procedural and OOP

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

What is declarative programming?

A

States the desired result rather than the exact instructions required to be performed to get there.

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

How do you add in LMC?

A

ADD

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

How do you subtract in LMC?

A

SUB

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

How do you store a value from the accumulator to a memory location in LMC?

A

STA

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

How do you load a value from a memory location to the accumulator in LMC?

A

LDA

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

How do you get a user to input a number in LMC?

A

INP

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

How do you print a value that is in the accumulator in LMC?

A

OUT

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

How do you stop a set of code from running in LMC?

A

HLT

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

How do you create a flag with a label at which data is stored?

A

DAT

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

How do you branch if the value in the accumulator is zero in LMC?

A

BRZ

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

How do you branch if the value in the accumulator is positive in LMC?

A

BRP

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

How do you branch no matter what in LMC?

A

BRA

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

What are the advantages of OOP?

A

A high level of reusability
Inheritance and polymorphism can be used
Encapsulation can be used to protect attributes
Modular structure so easy to maintain and update
High level of abstraction that is not necessary for programmers to know how to use.

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

What are the disadvantages of OOP?

A

Requires an alternative style of thinking
Not suited to all problems - where stuff does not need to be reused it is inefficient
Generally not suitable for small problems