Mapa mental
7. Programming
Conteúdo do mapa
7. Programming
Algorithms are a series of steps to solve a problem
- Flowchart
- Pseudocode
Control Flow
- Sequence - the order in which the steps need to happen
- Selection
- IF...THEN...ELSE, allows you to choose between 2 choices
- Nested If Statements
- Iteration
- FOR Loop
- REPEAT Loop
- WHILE Loop
Programming Languages
- 3rd Generation = High Level Languages such as Python (uses Statements)
- Portable, will work on different machines
- designed with a type of problem in mind
- One high level program instruction will be translated into several machine code instructions
- 2nd Generation = Assembly Language such as Little Man Computer (Uses mnemonics)
- 1st generation = Machine Code such as Binary (uses 0's &1's)
- designed with hardware in mind
- one instruction set per processor
- wont work on another machine
- Translating programs into machine code
- Must happen so it can run on the processor
- Assemblers - convert assembly language into machine code. A simple conversion as every assembly language instruction is translated into a machine code instruction
- Compliers & Interpreters - convert high level programming language into machine code. This is a more complex translation, as a single instruction can result in many machine code instructions
- Compliers
- Translates the whole program to produce the executable object code
- The object code runs in the version that the computer runs
- Faster run time because the program is already in machine code
- Customers can not see the actual code
- Used for distributed software
- Interpreters
- Translates and executes one line at a time
- The source code is the version that the computer runs
- Slower run time because the program is translated every time it is run
- If you distributed source code with an interpreter then customers would have your actual code
- Used in development
- Compliers
- Must happen so it can run on the processor
- 3rd Generation = High Level Languages such as Python (uses Statements)
Handling data in Algorithms
- Constants are certain values that remain the same while the program runs , i.e. VATRate=0.2,
- Identifier, a unique name given to a value
- declared at the start of a program
- Variables
- Has an identifier which refers to a location in memory where the data item will be stored
- Declared at the start
- Data types
- Integer
- A whole number
- DIV
- MOD
- A whole number
- Real
- A numbers with a fractional part
- Char
- A single character
- String
- zero or more characters
- Boolean
- True/ False
- Integer
- Constants are certain values that remain the same while the program runs , i.e. VATRate=0.2,
Arrays, a group of data items of the same data type , which is stored under one identifier
- Benefits
- Code is easier to follow and therefore easier to debug
- A group of data items can be easily processed using a for loop
- Benefits
Errors
- In a high level language a translator will scan each line of code
- Syntax errors - mistakes typing the code i.e. prnt instead of print
- Logical error - the code runs but does not do what you want
- In a high level language a translator will scan each line of code
Testing
- Normal data
- Erroneous data
- Boundary/ extreme data
IDE Tools
- Integrated Development Environment , allows you the write the code more easily
- WYSIWYG
- What you see is what you get
- Editing environment
- colour coding key words
- Numbering of lines
- The feedback you see when you try to run the program is provided by the runtime environment
- Break point - allows the program to stop the program from running at a certain point to allow them to check the values of certain variables
- Translator - translates the code into machine code
- Recognises comments put into the program by the developer
- WYSIWYG
- Integrated Development Environment , allows you the write the code more easily
Informações
- Descrição
- Mapa Mental sobre 7. Programming, criado por Sarah Barkhouse em 12-05-2015.
- Criado por
- Sarah Barkhouse
- Visualizações
- 1
- Avaliação