1.2.4 Types Of Programming Language Flashcards

1
Q

Programming paradigm

A

A philosophy, style or general approach to writing code

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

Imperative languages

A

A series of instructions that tell the computer exactly how to deal with a program and deal with a problem

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

3 types of imperative language

A

Structured, procedural and object-oriented

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

Structured

A

A series of procedures or functions that can be reused split a large program into manageable chunks

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

Declarative language

A

The user inputs the desired result but not how to get there and the computer does the work
Sets rules and answers questions

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

Logic programming

A

Expresses the logic of a computation without expressing its control flow
Defines a set of facts and rules based on the problem

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

Declarative language used

A

Medical diagnosis, oil exploration, processing natural language

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

Assembly language facts

A

Different for every type of processor
Assembler translates to machine code for execution
Each has it’s own instruction set called an instruction set architecture

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

What are the last 2 bits of the opcode?

A

The addressing mode, clarifies what the operand means

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

Little man computer

A

Only has 11 instructions

The imaginary computer it runs on has only 100 memory locations (7 bits)

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

LMC ADD x

A

Adds the contents of the memory address x to the value in the accumulator

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

LMC SUB x

A

Subtracts the contents of the memory address x from the value in the accumulator

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

LMC STA x

A

Stores the value in the accumulator in the memory address x

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

LMC LDA x

A

Loads the value in the memory address x to the accumulator

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

LMC HLT

A

Stops the program

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

LMC INP

A

Allows the user to input a value to the accumulator

17
Q

LMC OUT

A

Outputs the value in the accumulator to the screen

18
Q

LMC BRZ x

A

Branch if the contents of the accumulator equal 0

19
Q

LMC BRP x

A

Branch if the contents of the accumulator are greater than or equal to 0

20
Q

LMC BRA x

A

Branch always

21
Q

LMC how do branches work?

A

You make a branch name after the BRA/BRP/BRZ and call it before a line to show where you skip to

22
Q

LMC x DAT

A

Creates a variable using variablename DAT

23
Q

Immediate addressing

A

The operand holds an actual value

24
Q

Direct addressing

A

The operand holds the address of the value

25
Q

Indirect addressing

A

The location holding the address of the value

26
Q

Indexed addressing

A

The address of the operand is obtained by adding the value to a base address which is stored in the input register. Used for accessing an array whose elements are in successive memory locations

27
Q

Reading from file pseudocode

A

myFile = openRead(“filename.txt”)
line = myFile.readLine()
myFile.close()

28
Q

Determining end of file

A

myFile.endOfFile()

29
Q

Writing to a file

A

myFile = openWrite(“filename.txt”)
myFile.writeLine(“text to write”)
myFile.close()