Computing - Programming Flashcards
What is a parallelogram in a flowchart?
Represents input or output of data
What is a rectangle in a flowchart?
A process
What is a diamond in a flowchart?
A decision
What is pseudo code?
A programming language that uses program code and English
It is used to plan the way an algorithm works
What are the differences between sequence, selection and iteration?
Sequence is a simple list of code instructions that are carried out in order
Selection uses a condition to decide which pathway to be taken (if statements)
Iteration repeats sections of code a certain number of times or until a condition is true (for and while loops)
What is a nested loop?
When there is selection or iteration inside another selection of iteration
What is a variable?
A value in a program that can be changed by the code
It acts as storage of a value
What are the 5 main data types and what do they do?
String (stores text as a string of characters) Integer (stores whole numbers) Real (stores decimal numbers) Boolean (true or false) Character (stores a single character)
How much memory is needed for each data type?
String (number of characters in bytes) Real (4 or 8 bytes) Integer (2 or 4 bytes) Character (1 byte) Boolean (1 bit)
What is an array?
A variable that stores multiple pieces or information
Each piece of information has a reference number in the array
What are the 5 main string handling functions?
Length (number of characters) Left, Right and Mid string Ucase and Lcase (converts to upper or lower case) Asc (gets ASCII value of character) Chr (gets character from an ASCII value)
What are the 3 levels of programming languages and what do they do?
Machine code (1s and 0s that the computer can execute directly) Assembly code (mnemonics for machine code) High level code (where English words are used as code)
What is a translator?
A tool that translates machine, assembly and high level code into one another when required
What is the difference between syntax errors and logical errors?
Syntax errors are where the program has actually been written so that the computer can’t understand it (syntax is wrong)
Logical errors happen when the program has a fine syntax but does something different than to what the programmer wants
What steps should be taken when testing a program?
Valid (does normal data work?) Valid extreme (does data that is almost out of range but is still acceptable work?) Invalid (data that is out of range should be rejected) Invalid extreme (data that is almost acceptable but not quite should be rejected) Erroneous (data that is the wrong type of input should be rejected)