A flowchart is an industry-standard design tool, which is used to show an algorithm diagrammatically.
Shows where the algorithm starts and finishes.
Shows an input to the system. Can be something that the user types in or scans, such as a ProductID on a barcode.
Always asks a question and has different routes out depending on the answer.
Something that happens, always includes a verb.
A file or database.
Something that is shown to the user.
A procedure is a self-contained section of code that performs a specific task. It may return one or more values but doesn't have to.
PROCEDURE FindCarDetails()
.
.
.
.
ENDPROCEDURE
The key difference between a function and a procedure is that a function will always return a single value.
Parameter passing is when the program has variables, you can use them while calling a function and telling it to use the different variables.
An actual parameter is when you call a procedure and pass it the value of a variable or an actual value.
Global variables are variables that are declared in the main part of the program so that they can be accessed anywhere in the code, including within procedures and functions.
Local variables are variables that are declared within a function or procedure and are only available within that sub-routine.
Local variables will be used before Global variables.
A syntax error is when the compiler will not be able to translate the high-level programming language into machine code and will not be able to compile giving an error.
1) Mistyping a key word: PRNIT instead of PRINT.
2) Missing key words out of constructs such as starting a REPEAT loop but no writing UNTIL anywhere.
3) Opening brackets but not closing them
4) Not having the right number of parameters inside brackets for functions.
A logical error is when the program will run (due to no syntax errors) but may not perform as we expected or return the wrong answer.
1) Missing brackets from mathematical calculations.
2) Loops that do not execute the correct number of times.
3) Variables have not been initialised, or have been initialised in the wrong place (often incorrectly initialised inside the loop instead of just before it).
4) Flawed algorithms that just don't do what they were intended to do.
Run-Time errors occur once a program has started running. Sometimes the program will run and sometimes it might crash.
1) When a program is expecting user input that is one data type but the input from the user is another.
2) When the program tries to open a file that no longer exists.
3) When the program tries to read from a file that is empty.
4) When the computer runs out of memory for some reason.
A trace table is a standard tool for tracking how the value of each variable changes as you go through your algorithm line by line.
The editing environment will have several features that will help users find errors: these include colour-coding key words / highlighting syntax errors, numbering the lines and auto-completing constructs for you.
A data structure is when you group data items together so they can be treated as a set of data.
A Comma-Separated Value file is a text file that separates data using commas. This data can also be opened in other software such as excel that will recognise the commas and show the data accordingly.
Library Programs are modules of code that can be used in your programs.
1) They perform standard functionality in a way users expect it to.
2) They have already been written for you - saves time.
3) The routines have already been tested.
4) They can be called anywhere in your program.
An open source program is a program that programmers freely share.
1) Software is licensed for use but there is no charge for the license. Anyone can use it.
2) Open source software must be distributed with the source code so anyone can modify it.
3) Developers can sell the software they have created.
4) Any new software created from open source software must also be "open". This means that it must be distributed or sold in a form that other people can read and also edit.
Pseudocode is when we write an algorithm in programming-style constructs but not in an actual programming language.
A sequence is when the boxes are read left to right, these boxes happen one after another, in that order.