4.2 Programming Languages, translators and IDE's Flashcards

1
Q

Explain what is meant by the term “high level language”

A
  • Written in a form that is close to our human language
  • No knowledge of hardware/architecture required
  • Portable - machine independent
  • Examples: C#, Python etc.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Explain what is meant by the term “low level language”

A
  • Written in a form that is close to the processor instruction set
  • Knowledge of hardware/architecture is required
  • Not portable - machine dependent
  • Examples: assembly language and machine code
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

State 3 advantages of a high level language

A
  • Easier to understand for programmers
  • Portable - not machine specific
  • No need to understand the architecture of a computer
  • One instruction equals many processor instructions
  • Much easier to debug and test
  • Only need to learn a single language
  • Has built in libraries and functions that can be reused
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

State 3 advantages of a low level language

A
  • Program often requires less memory/RAM
  • Can make use of special hardware
  • Can use memory addresses directly
  • Can be written to run faster (optimised)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Explain two reasons why a computer programmer may choose to write a program in a high- level language, rather than a low-level language.

A
  • Closer to human language/English …
    • …so it is easier/quicker to read/write/understand/debug
  • The program can be used on many different platforms…
    • …because it is compiled into object code
  • They have built-in functions/libraries…
    • …this saves time when writing the program
  • Do not need to manipulate memory addresses directly…
    • …therefore, specialist knowledge of this is not required
  • Only need to learn a single language…
    • …as this can be used on many different computers
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Explain two reasons why a computer programmer may choose to write a program in a low-level language, rather than a high-level language.

A
  • allows direct access to computer processor / special hardware //
  • machine dependent instructions uses up less memory
  • can increase the speed of processing a program // executes instructions faster
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

State 3 different translators

A
  • Assembler
  • Compiler
  • Interpreter
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

State a translator that can be used to translate a low level language into machine code

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

State 2 different translators that can be used to translate a high level language into machine code

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

Describe how an interpreter translates a computer program

A
  • Translates high-level language into machine code
  • Translates (the source code) line by line/statement by statement
  • The interpeter is used each time the code is executed
  • Stops if it finds an error and will only continue when error is fixed
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Describe how a compiler translates a computer program

A
  • Translates high-level language into machine code (object code)
  • Translates (the source code) all at once
  • Produces an executable file
  • Produces an error report / list of errors
  • Optimises the source code (to run efficiently)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Describe how an assembler translates a low level language

A
  • Translates (the source code) all at once
  • Produces an executable file
  • Produces an error report / list of errors
  • Optimises the source code (to run efficiently)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Assembly language: True or False?

  • Assembly language uses mnemonic codes.
  • Assembly language programs do not need a translator to be executed.
  • Assembly language is a low-level programming language.
  • Assembly language is specific to the computer hardware.
  • Assembly language is machine code.
  • Assembly language is often used to create drivers for hardware.
A
  • Assembly language uses mnemonic codes. TRUE
  • Assembly language programs do not need a translator to be executed. FALSE
  • Assembly language is a low-level programming language. TRUE
  • Assembly language is specific to the computer hardware. TRUE
  • Assembly language is machine code. FALSE
  • Assembly language is often used to create drivers for hardware. TRUE
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Interpreter or Compiler?

  • Translates the source code into machine code all at once
  • Produces an executable file in machine code
  • Executes a high-level language program one instruction at a time
  • Once translated, the translator does not need to be present for the program to run
  • An executable file is produced
A

Translator or Compiler?

  • Translates the source code into machine code all at once Compiler
  • Produces an executable file in machine code Compiler
  • Executes a high-level language program one instruction at a time Interpreter
  • Once translated, the translator does not need to be present for the program to run Compiler
  • An executable file is produced Compiler
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Interpreter or Compiler?

  • A report of errors is produced at the end of translation
  • The program is translated one line at a time
  • The program is translated from high-level language into machine code
  • An executable file is produced
  • The program will not run at all if an error is detected
A

Translator or Compiler?

  • A report of errors is produced at the end of translation Compiler
  • The program is translated one line at a time Interpreter
  • The program is translated from high-level language into machine code Compiler & Interpreter
  • An executable file is produced Compiler
  • The program will not run at all if an error is detected Compiler
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Why might you use a compiler rather than an intrepreter?

A
  • Compiled program can be executed without a translator
  • Faster execution as it is not translated line by line
  • Provides an executable file therefore you cannot see the code
17
Q

Why might you use an interpreter rather than an compiler?

A
  • Faster for developing software and debugging …
    • all of the code does not need to be translated
    • can execute code quickly (line by line)
18
Q

What is an IDE?

A
  • Integrated Development environment
  • A software application used by programmers that …
  • … provides a range of features to support program development
19
Q

Name 3 features of an IDE

A
  • Code Editor
  • Translator
  • Runtime environment with a debugger
  • Error Diagnostics
  • Auto-completion
  • Auto-correction
  • Auto-documenter and prettyprinting
20
Q

What is the purpose of a code editor in an IDE?

A
  • Allows the program to be written without a separate text editor
  • Speeds up the development process
21
Q

What is the purpose of a translator in an IDE?

A

This could be an interpreter or compiler and enables the code to be translated to machine code and executed

22
Q

What is the purpose of a runtime environment in an IDE?

A
  • Often contains a debugger
  • Allows the programmer to step through the code line by line
  • Can set breakpoints to stop execution
  • A report window shows the values of variables to check logic errors
23
Q

What is meant by error diagnostics in an IDE?

A

Dynamic error checking finds possible errors whilst writing

Shows a list of syntax errors after compilation

24
Q

What is meant by auto-correction in an IDE?

A

Underlines errors and dynamically suggests corrections as code is being typed

25
Q

What is meant by auto-completion in an IDE?

A

Code editors can offer to complete instructions and key words as they are being typed

26
Q

What is meant by an auto-documentor in an IDE?

A

An auto-documentor explains the functions and purpose of built in code

27
Q

What is meant by prettyprinting in an IDE?

A

Key words are colour coded and code is indented and structured meaningfully