Chapter 7 Flashcards
Algorithm
A series of steps to solve a problem. Can be expressed in structured English, pseudocode or as a flowchart (also called flow diagram).
Flowchart/Flow Diagram
A diagram using commonly defi ned symbols to express an algorithm.
Structured English
A way of writing an algorithm in natural language using some basic programmingconstructs such as IF…THEN…ELSE and loops. More structured than just natural language/prose.
Pseudocode
A way of writing an algorithm that is close to actual programming language, usingcoding-style constructs such as IF…THEN…ELSE, loops and array notation as appropriate.
Hungarian Notation
The convention of prefi xing identifiers to indicate what type of object they are.Commonly used with forms where, for example the prefix txt might indicate a textbox and lst might prefix a list box. The prefix is conventionally in lowercase.
camelCase
The use of capital letters in an identifier to make them more readable. With camelCase the first word is not capitalised:txtCustomer, lstCounty, frmAddCustomer, btnSubmit
PascalCase
The use of capital letters in an identifier to make it more readable. For example,variable and procedure identifiers: StudentNumber, ProductID, StartPoint, CalcTotal
(programming) Sequence
Where instructions are executed one after another in series.
(programming) Selection
Where the program will execute certain instructions based on conditions. Selectionstatements include: IF…THEN…ELSE and CASE…OF to select which commands to execute.
(programming) Iteration
Where a program will execute a group of instructions zero or more times based on a condition. FOR loops will execute instructions a specific number of times, REPEAT…UNTIL loops one or more times and WHILE…DO loops zero or more times.
(programming) Condition
A boolean expression that controls an iteration or selection statement. Forexample, REPEAT…UNTIL X=10, where X=10 is the condition.
(programming) Boolean Expression
An expression that is true or false. For example: continue=”Y”Expressions can be more complex, containing several parts: ((continue=”Y”) or (continue=”y”)) and (tries
High Level Programming Language
A programming language where programming constructs are written in a waythat is close to natural language instead of in mnemonics or machine code. For example, Delphi, Pascal, Visual Basic, Java, C++.
Imperative Language
Programming language such as Python or Delphi which uses a sequence of statements to determine how to reach a certain goal or solve a problem.
Assembly Language
Second generation programming language where instructions are in the form ofmnemonics.
Mnemonics
Abbreviations representing commands used in assembly language programming.For example, LDA, STO, ADX.
Machine Code
First generation code; binary instructions where some bits are used to define theoperation (called the “opcode”) and some bits define the data to be used.
Translator
The piece of systems software used to convert different programming languagesinto machine code. Three types: assembler, interpreter and compiler.
Interpreter
A translator that converts high level languages into machine code one line at a time, checking syntax, converting to machine code and executing the code.
Compiler
A translator that converts high level languages into machine code. Works through the whole program (source code) checking the syntax, then converting to machine code and creating the executable object code, which can be saved. The object code is executed, not the source code.
Source Code
The original high level program.
Object Code
The executable version of the program after it has been compiled.
Assembler
The translator that converts assembly language programs into machine code.
Identifier
A unique name for something (variable, constant, program, procedure etc.) withinthe program.
Constant
A named value within a program that has a specific value. Its value does notchange while the program is running.
Variable
An identifier associated with a particular memory location, used to store data. Itsvalue may change as the program is run and new values are assigned to it.
Data Type
A formal description of the type of data being stored in a variable. It defines theamount of memory required and the type of operations that can be performed onthat variable. Typical data types include Integer, real, string, boolean
Integer
Data type for whole numbers. Typically uses 2 bytes.
Real
Data type for fractional numbers. Typically uses 4 bytes.
Char
Data type for a single character. Typically uses 1 byte.
String
Data type for text, zero or more characters. Typically uses 1 byte per character.
(programming) Operations
The actions that can be performed on a variable.
Arithmetic Operations
Add, subtract, multiply, divide, integer division (DIV) and modulus (MOD)
Comparison Operations
= =
Logical Operators
NOT AND OR
Array
A group of data items of the same data type that use a single identifi er. Individualdata items are accessed using a subscript.
Syntax
A set of rules that defi nes how program statements must be written in order for the translator to understand them.
Syntax Errors
An error in the format of the program statements such as missing semicolons orkeywords spelt incorrectly.
Logic Errors
An error in the algorithm that means the outcome is not as expected, even thoughthe program will run.
Valid Data
Data that should be allowed by the program. For example, if a range of 1 to 10 isallowed, then valid data will be any number between 1 and 10 inclusive.
Invalid Data
Data that is not valid and should be rejected by the program. For example, if arange of 1 to 10 is allowed, then invalid data will include abc, -251, 0, and 11
Boundary Data
Data either side of the range extremes. For example in a range of 1 to 10 boundarydata will include 0, 1, 10 and 11