WEEK 2.10 Flashcards

1
Q

programming/coding

A

consists of instructing a computer to perform tasks

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

program/algorithm

A

sequence of instructions which maniputes data

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

coding languages

A

way of communicating with computer to code

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

low-level language

A

language whose instructions are close/identical to processor’s own instructions

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

high-level language

A

language whose instructions resemble English and are far from the computer’s own language

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

translation method from high-level language to computer

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

compiler

A

translate whole program into machine code, then program can be executed

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

interpreters

A

translate and execute program into machine code, one instruction at a time

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

trade-off between instruction set size and program length

A

the larger the instruction set of a language, the smaller the size of a program for a given task

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

low-level language instruction set size

A

small

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

high-level language instruction set size

A

large

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

simplest coding language

A
  • Hao Wang’s register machine
  • only three instructions: Inc, Deb, End
  • sufficient to process any computation
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

register machine

A

idealised, imaginary (and perfectly possible) computer that consists of nothing but a finite number of registers and a processing unit

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

registers

A

memory locations where numbers are stored

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

Inc n,m

A

increase value of register by n and go to step m

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

Deb n,m,p

A

if value of register is n>0, decrease value of register by 1 and go to step m, else go to step p

17
Q

End

A

end the program

18
Q

special purpose language

A

domain specific, can only carry out a restricted set of tasks specific to that domain (e.g. HTML)

19
Q

general purpose language

A

domain neutral, can carry out any computable task (e.g. Python), Turing complete

20
Q

Turing complete

A

allow the creation of programs that can emulate any machine

21
Q

control structures

A
  • instructions that control program’s behaviour and flow
  • 2 types: selection and repetition structures
22
Q

selection structures

A
  • produce decisions and branching
  • employ logical condition
  • e.g. if-then
23
Q

repetition structures

A

produce loops where the same part of the code runs more than once over distinct values (e.g. for, while)

24
Q

Python

A
  • general-purpose programming language that comes with both an interpreter and a compiler
  • widely used because allows users to code easily and simply
25
Q

libraries

A
  • made up of modules
  • used by programming languages
  • offer supplementary collections of functions