5. Implementing Software Solutions Flashcards
Define Metalanguage
A language used to describe the syntax of other languages
EBNF
<> for variables (non-terminal elements), [] for optional, {} for 0 or more, | for or
Railroad Diagrams
Rectangles for variables (non-terminal elements), circles for literal (terminal elements — written as they appear), outward semicircle for loop, inward semicircle for or
Define Identifier
The name given to a variable, subroutine or function. They must commence with a letter
How are input statements used in programming?
Input statements are used to obtain data and store it in some variable. The source of the data may be the keyboard, a file or some other peripheral device.
How are output statements used in programming?
Output statements are used to send data to devices. This could be the monitor, printer, a file or almost any other output device.
Define assignment
The process of storing the value of an expression in a variable
How are assignment statements used in programming?
Assignment statements are used to set the value of variables and properties. Assignment is not the same as equivalence.
How is sequence used in programming?
It is the control structure that ensures each process is executed in the correct order. In most programming languages sequence is implemented by writing statements in their correct order; each statement being separated by some character.
How is selection used in programming?
By binary selection
How is repetition used in programming?
There are two types of repetition – pre-test and post-test
Syntax errors
Result when source code statements do not adhere to the rules of the programming language. All syntax errors will be detected as the source code is translated into object code.
Runtime errors
Result when for some reason the computer is unable to continue executing instructions. They can be caused by either software or hardware faults. Exceptions are types of runtime errors. Exception handlers are executed when an exception of a particular type occurs.
Examples of runtime errors
Mathematical calculations that cannot be evaluated e.g. division by zero, attempting to find the square root of negative numbers, tan 90
Inaccuracies due to non exact floating point representations e.g. 0.99999999 multiplied by 2 gives the result 2
Data that is out of the range of the identifier’s data type e.g. 16-bit integers will have a range from -32768 to 32767
Infinite calls to subroutines/recursion
Logic errors
When programs do not correctly work as anticipated. The program may continue to execute, albeit incorrectly. They are the most difficult errors to correct.