YEAR 1 CO1 WEEK 12 PROGRAMMING LANGUAGES Flashcards
Why do we use programming languages?
Instructions in CPU in binary. People find this hard to write so we have human friendly languaged developed to help write programs.
Describe Machine code.
CPU can only process binary data including program instructions themselves.
Different binary numbers represent particular instructions so machine code for one CPU might not run on another CPU.
Describe Assemblu language.
Assembly language made up of predetermined set of commands that can be read by a human.
Each command directly translates into machine code number.
Low level language as nearly same as machine code due to being low level abstraction.
Uses mnemonics which have a direct link to its machine code equivelant.
Describe procedural language.
Procedural computer language allows programmer to set out step by step what computer needs to do and how to do it.
What are the properties of a procedural computer language.
Is an imperative language (gives orders or instructions )
Sequential (instructions carried out one after another)
Has statements in blocks called procedures and functions.
Define program flow.
The path that the program follows.
Either simple or complex depending on what it is asked to do.
Key features of a procedure.
Can take one or more inputs called arguments.
Performs an operation using arguments.
Not return a value.
Key features of functions.
Named sections of code.
Called as part of an expression.
Returns a single value to place function was called from.
Takes one or more inputs called arguments.
Define reserved words.
Words that cannot be used as an identifier as has a special meaning to the compiler.
Local variable.
Declared inside function.
Can be accessed only within function or block it was declared in.
Global variable.
Global variable declared outside of function.
Accessible throughout entire program.