1.2.4 types of programming language Flashcards

(20 cards)

1
Q

programming paradigms

A

style of programming (one/multiple paradigm can exist in a language)

-procedural
-declarative
-OOP
-functional

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

procedural

A

sequence of subroutines/instructions called to achieve the result

how to control the flow:
-sequence
-selection
-iteration
-recursion

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

imperative vs procedural

A

imperative is under procedural

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

declarative

A

state the end result wanted
e.g. SQL

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

funtional

A

reusing a set of functions, like function calls; closely linked to mathematics
e.g. Java

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

assembly language

A

low level language
-uses mnemonics
-one level up from machine code
-converted to machine code using an assembler

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

LMC

A

little man computer :
- uses mnemonics
- processor-specific

instructions:
-LDA
-STA
-OUT
-INP
-ADD
-SUB
-BRA
-BRP
-BRZ
-HLT
-DAT

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

modes of addressing

A

-immediate
-direct
-indirect
-indexed

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

immediate

A

operand held the value needed to perform the instruction

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

direct

A

operand gives the address which holds the value

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

indirect

A

operand gives the address that points to another address that holds the data needed

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

indexed

A

the sum of the value in operand and indexed register gives the address of the data that is needed

-useful in accessing arrays (and reason for arrays to be stored contiguously in memory location)

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

OOP

A

object oriented programming
-program consist of objects, each has attributes and methods
-all processing is done by objects

related terms:
-class
-objects
-attributes
-methods

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

classes

A

-blueprint of an object
-defines attributes and methods that capture the common characteristics and behaviours of objects

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

attributes and methods

A

attributes: the data
methods: the behaviour of the object

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

polymorphism

A
  • objects can behave differently depending on their class
  • overriding: redefine the methods of the parent class to suit itself
  • overloading: passing in a different parameter into the method
17
Q

ENCAPSULATION

A

-attributes and methods wrapped onto a single entity
-attributes are hidden(private) and changed only through method
-methods help get and set attributes; methods are public and accessible

18
Q

inheritance

A

-relationship among classes where a sub-class shares all of the attributes and methods of a parent class
-inherited class may have methods and attributes that does not exist in parent class

determining the appropriateness of the inheritance:
-is object A an object B?

19
Q

private and public

A

encapsulation method

private: make sure attributes cannot be directly accessed and edited by users

20
Q

methods to manipulate data in OOP

A

constructor: create an instance of the object
getter: get the data attribute
setter: set the data attribute
-> to prevent users from accidentally changing the data (security and referential integrity?)