programming languages keywords Flashcards
What is sequence ?
The order in which code is executed
What is selection ?
A programming construct where a section of code is only run if a condition is met ie IF statement
What is iteration ?
The repeating of code a specified number of times or until a condition is met ( a loop)
What is a high level language ?
A programming language which closely resembles the natural language - the spoken and written language of humans
Examples: Python, Visual basic, Java, C++
What is a low level language ?
A programming language close to the computer’s own language
Examples: Machine code and assembly language
What language can processors execute instructions in ?
Machine code
Will a program written in machine code for a PC run on an Apple smartphone ?
No, because machine code instructions are made specific to a particular processor or group of processors
What is assembly language ?
It is a low level language which replaces machine code with mnemonics and operands to make it easier to read and write.
What is an operand ?
a term used to describe any object that is capable of being manipulated.
For example, in “1 + 2” the “1” and “2” are the operands and the plus symbol is the operator.
What can assembly language be used ?
- In software that is used in embedded systems such as a washing machine
- In software used to control specific hardware components like device drivers
What are the advantages of a high level language ?
- Easier to learn
- faster to write
- easier to understand and debug
What are the advantages of a low level language ?
- programs can run very quickly
- code usually requires less RAM
- Statements in LLL can be used to control and manipulate specific hardware components
What is a translator ?
Translates from one programming language to another
What are the three types of translators ?
Interpreter, compiler and assembler
What does a compiler do ?
Creates an executable file for a program, source code translated all in one go
Translates from a high level language to machine code
What does an interpreter do ?
Translates and executes code line by line
Translates from a high level language to machine code
What does an assembler do ?
Assembles the code so that it can be run later
Translates from assembly language to machine code
Advantages of a compiler
- Compiled programs run quickly as they have already been translated
- Can be supplied as an executable file which is preferred by programmers, as an executable file cant easily be modified ( without permission)
- Compilers optimise code so that it runs quicker and takes up less memory space
What does it mean to optimise code ?
To make the code for a program more efficient.
A program can be optimised to run quicker or take up less memory.
What are the disadvantages of compilers ?
- Source code must be recompiled whenever the programmer changes the program
- Source code that is compiled on one platform won’t run on another as the machine code is processor specific.
What are the advantages of an interpreter ?
- Instructions are executed as soon as they are translated
- Errors can quickly be spotted ( the user is straight away notified at which part of the program the interpretation has failed)
What are the disadvantages of an interpreter ?
- Interpreted programs run slowly as the processor has to wait for each instruction to be translated before it can be executed
- Program has to be translated every time it is run
- Interpreters don’t produce an executable file ( so source code has to be supplied and it could be modified without permission)
- Interpreters don’t optimise code
What does a variable do ?
Holds a value in a memory location that is needed to carry out your program
Can only hold one value at a time, value can change.
What is an array ?
A data structure that holds similar related data