programming languages Flashcards

1
Q

What is system software?

A

Needed by the computer to keep the system running

performs the tasks needed to operate the hardware

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

What is application software?

A

Useful for the user, allows them to perform tasks such as writing a letter

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

Give three examples of system software

A

operating system
library programs
utility programs

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

Give the three types of application software

A

general purpose
special purpose
bespoke software

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

What does the operating system do?

A

Acts as an interface between user and hardware, provides a ‘virtual machine’
eg by displaying files as distinct sections which can be dragged etc

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

What are library programs?

A

Pre-compiled routines for re-use

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

Give three examples of utility programs

A

disk formatter, file compressor, firewall etc

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

Give two examples of general purpose application software

A

word processor, spreadsheet

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

Give two examples of special purpose application software

A

payroll, tax calculator, (web browser)

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

What is bespoke application software?

give two examples

A

Software which has to be specially written for a specific purpose, it cannot just be bought off the shelf
eg London congestion simulator, air traffic control

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

What is machine code?

A

instructions which a computer can respond to directly without having to translate

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

What are the disadvantages of machine code?

A
  • slow and tedious to write
  • Hard to debug
  • Machine specific, every type of computer has a different set of instructions
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is assembly language?

A

Still machine specific but had mnemonics (more meaningful abbreviations for instructions) and comments, labels and variables. Must be translated back to machine code before use.

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

When was assembly code developed?

A

The 1950s

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

When were high level languages developed?

A

The late 1950s

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

Name two of the first high level languages

A

FORTRAN and COBOL

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

What is the difference between high level languages and assembly and machine code?

A
  • High level languages are problem centred, independent of different hardware platforms
  • One line of high level language can correspond to lots of lines of machine code instructions, the lower levels have a one to one relationship
18
Q

What are the advantages of high level languages?

A
  • Easier to read, write and debug
  • More like a natural language, usually based on syntax similar to English
  • Not machine specific
19
Q

What are the disadvantages of high level languages?

A

Needs to be translated much more than the others as one line of code can be much more than one line of machine code

20
Q

What are the different types of high level languages known as?

A

programming paradigms

21
Q

What are the two kinds of programming paradigm?

A

imperative/procedural and declarative

22
Q

What is an imperative/procedural language?

A

A list of commands to be executed in sequence

23
Q

Give two examples of an imperative/procedural language

A
  • pascal

- C

24
Q

What is a declarative language?

A

A program which defines rules and goals without specifying a precise flow of control, often used for AI

25
Q

Give three examples of declarative languages

A

LISP, prolog, SQL

26
Q

Give the generations of programming language in order

A

1=machine code
2=assembly language
3=high level languages
4=declarative languages

27
Q

Why might assembly code still be used?

A
  • You have more complete control over the hardware
  • more efficient as program will run faster
  • uses less memory
  • useful for low level software or for writing compilers for higher level languages
28
Q

What is a compiler?

A

an automatic machine code translator for high level languages

29
Q

What are the two kinds of translator?

A
  • assembler

- compiler/interpreter

30
Q

What is an assembler?

A

Translates assembly code to machine code

The relationship is one to one so the translation process is quite simple

31
Q

What do compilers/interpreters do?

A

Translate high level languages to machine code

32
Q

What is the difference between an compiler and a interpreter?

A
  • compilers takes the source code and translates and saves it as an executable file (which can then be re-used without further translation)
  • interpreters translate the source code one line at a time, executing it immediately(no machine code version is saved)
33
Q

What are the advantages of compilers?

A
  • Better if you need to run source code repeatedly(including running loops inn the program)-faster because it doesn’t have to be translated repeatedly
  • A user doesn’t have to have any translation software to run an executable file
  • A user cannot see the source code from an exe file, protecting intellectual property
34
Q

What are the advantages of interpreters?

A
  • Easier to write than compilers

- Use fewer resources

35
Q

What is the role of interpreters in the internet?

A

most webpages contain javascript sent as plain text and web browsers have javascript interpreters
Every computer accessing the web page (with different operating systems) can interpret the code itself for the relevant operating system

36
Q

Why do webpages not send script as an executable file?

A

exe files are platform specific, so would not work on all computers accessing the page

37
Q

What are hybrid/two-stage models?

A

Some modern languages (eg java) translate in two stages, using compilation and interpretation

38
Q

How does hybrid/ two stage translation work?

A
  • The source code is translated to bytecode, a platform independent intermediate stage
  • By run time the byte code is compiled or interpreted to machine code
39
Q

What are the advantages of byte code?

A
  • It can be distributed regardless of operating system
  • copyright is protected
  • It is the same whatever the original language was
40
Q

What are the disadvantages of byte code?

A

Software (eg java) has to be installed to interpret the byte code

41
Q

What is software?

A

consists of sequences of instruction which can be understood and executed by hardware

42
Q

What is the column on the left when machine code is written?

A

The memory adress