Programming languages Flashcards

1
Q

Define a programming paradigm

A

The approach a programming language takes to defining a program

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

What’s in assembly language

A
  • Mnemonics are used in place of machine code instruction
  • The set of instructions varies from processor to processor
  • Low level languages offer a high level of control
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Name 4 high-level paradigms

A
  • Procedural
  • Object-oriented
  • Functional
  • Declarative
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a procedural language and give examples

A

Instructions are given in sequence. These instructions can be grouped into subroutines that can be called throughout the program.
e.g. C, Python

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

What is a object-oriented language

A

The solution is represented by objects that interact. e.g. Java, C++

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

What is a functional language

A

A description of the solution to a problem is built up through a collection of functions.
e.g. Haskell, ML

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

What is a declarative language

A

The characteristics of a solution are stated, rather than stating how the problem is solved. e.g. Prolog, SQL

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

What are the 11 instructions in LMC and their functions

A

ADD - Add
SUB - Sub
STA - Store value from ACC to memory
LDA - Load value from memory to ACC
BRA - Branch always
BRP - Branch if positive
BRZ - Branch if zero
INP - Input
OUT - Output
HLT - End program
DAT - Data location

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