[Unit 1.2.4] Types of Programming Language Flashcards

software and software development

1
Q

define “programming paradigm”

A

fundamental style or approach to programming.

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

what are the features of high level languages

A

independent of hardware
translated by compiler/interpreter
one statement = many machine code instruction

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

what are the features of low level languages

A

Assembly:
- translated using assembler
- one statement = one machine code
Machine code:
- executable binary code
- produced by compiler/interpreter/assembler

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

what are the two types of high level languages

A

imperative languages
declarative languages

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

define “imperative language”

A

describe how to achieve result with step by step instructions
focus on control flow
- procedural
- OOP

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

define “declarative language”

A

describe what result should be, without specifying steps
focus on logic and constraints to determine outcomes
- logic
- functional
- SQL

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

define procedural programming

A

paradigm, follows step by step instructions. tasks broke down into procedures that operate on data

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

what are the key features of procedural programming

A
  • uses sequence, selection & iteration
  • divided into functions/procedures
  • follows top-down design
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

define “object oriented programming”

A

paradigm that models real world entities as objects containing data (attributes) & behaviour (methods)

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

what are the key features of object oriented programming

A
  • encapsulation
  • abstraction
  • inheritance
  • polymorphism
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

define “functional programming”

A

paradigm has no mutable data structures. uses mathematical expressions. same input will always result in same output

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

what are the key features of functional programming

A
  • pure function, no side effects.
  • higher order functions, functions can take other functions as arguments
  • recursion
  • immutability
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

what are the key features of logic programming

A
  • facts and rules instead of procedures
  • backtracking to search for solutions
  • declarative statements not step-by-step instructions
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

define “logic programming”

A

paradigm based on formal logic. rules and facts define relationships. queries used to find solutions.

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

what are the (Dis)advantages of procedural programming

A

ad:
- easy to write and understand
Dis:
- not reusable
- hard to maintain large programs

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

what are the (Dis)advantages of object oriented programming

A

Ad:
- organises code well
- reusable
Dis:
-overkill for small tasks (code bloat)
- increased complexability
- complicated for beginners

16
Q

what are the (Dis)advantages of functional programming

A

Ad:
- concise
- avoids side effects
Dis:
- Harder to read for beginners

17
Q

what are the (Dis)advantages of Logic programming

A

Ad:
- express rules declaratively
Dis:
- less practical for numerical operations

18
Q

why is OOP better than procedural

A
  • modular and reusable
  • maintainable
  • security
  • real-world mapping
  • collaboration
19
Q

what is the mnemonic for load in assembly language

A

LDA
- contents of memory location onto accumulator

20
Q

what is the mnemonic for Store in assembly language

A

STA
- copy accumulator to memory

21
Q

what is the mnemonic for Add in assembly language

A

ADD
- add contents of memory to accumulator

22
Q

what is the mnemonic for subtract in assembly language

A

SUB
- subtract memory from accumulator

23
Q

what is the mnemonic for input in assembly language

A

INP
- copy input box into accumulator

24
Q

what is the mnemonic for output in assembly language

A

OUT
- display accumulator in output box

25
Q

what is the mnemonic for Halt in assembly language

A

HLT
-stop executing program

26
Q

what is the mnemonic for branch always in assembly language

A

BRA
- unconditional branch, jump instruction.

27
Q

what is the mnemonic for branch if zero in assembly language

A

BRZ
- conditional branch, if accumulator value is 0, if not it continues

28
Q

what is the mnemonic for branch if positive in assembly language

A

BRP
- conditional branch, if accumulator is 0 or positive, if not it continues

29
Q

what is the mnemonic for Data location in assembly language

A

DAT
- assigns memory location to store value, gives identifier
- always declared at end of program
- will be allocated immediately after program