Topic 2 - Programming Flashcards
What is readability?
How easily program code can be understood.
What are three ways of enhancing readability?
- Comments
- Descriptive Variable Names
- Indentation
What is an error?
An occurrence of an unexpected result.
What are three types of errors?
- Logic (when results are different than expected)
- Syntax (structure and rules of program code)
- Runtime (Occurs during or after program execution)
What is a Test Plan?
A document outlining the stages of the testing process.
In a test plan, what are three categories that test data is usually put into?
- NORMAL (typical inputs)
- BOUNDARY (not so typical inputs)
- ERRONEOUS (inputs that just don’t work)
What is a Trace Table?
A method used to test for Logic Errors
What is an Integrated Development Environment (IDE) ?
An application that provides a selection of tools for programmers whilst coding.
What is debugging?
The process of finding and removing errors.
What is a Watcher?
A tool that ‘watches’ anything specified by the programmer.
What is a Breakpoint?
A tool that allows a programmer to halt the programmer’s execution at specified points.
What is ‘Stepping’ ?
The process of executing the program line by line.
What are four factors that make up a good program?
- Correctness
- Efficiency
- Robustness
- Understandability
What two purposes does Declaration serve?
- To reserve memory space
2. To ensure the compiler interprets and uses instructions correctly
What is a Command?
Instructs the computer to do something specific.
What is a Conditional?
A statement that evaluate to True or False (Boolean)
What are the three types of Control Constructs?
- Sequence
- Selection
- Repetition
How does a Sequence Construct work?
Each line follows the previous line (all lines are executed)
How does a Selection Construct work?
Decisions are made that choose the program’s execution
How does a Repetition Construct work?
Code is repeated (looped) until specified conditions are met.
What are the 5 Data Types?
- Integers (Whole numbers)
- Float (decimal point / fractional point)
- Boolean (one of two values)
- Character (letter, number, symbol)
- String (sequence of characters)
What is a variable?
A location in the memory containing data values.
What are Constants?
Identifiers associated with values that remain fixed during the program’s execution.
Why are variables used?
Allows you to store a value that can be used later on.
What are three advantages of using Constants?
- Improves readability
- Ability to update
- Compiler Optimisation
What is a Data Structure?
The conceptual arrangement of data.
What is an Array?
A data structure which stores data under a single identifier name by index position.
What are the two types of arrays?
One-dimensional arrays and two-dimensional arrays.
How does a 1D array store data?
In one horizontal direction
How does a 2D array store data?
Horizontally and vertically
What are the 3 ways of manipulating strings?
- Position
- Concatenation
- String Conversion Operations
In terms of hardware, what do I/O devices do?
They transfer data to and from a computer.
In terms of software, what is an input and an output?
Inputs introduce data to a program.
Outputs transfer data to something outside of the program.
What is a file?
A collection of data with a name, usually stored on a computer.
What is validation?
Ensuring the data the user inputs is sensible and usable,
What are the 4 types of validation?
- PRESENCE CHECK: Checks data that has actually been inputted.
- DATA TYPE CHECK: Checks whether the data type entered is correct.
- RANGE CHECK: Checks that the data inputted is within a set range
- LENGTH CHECK: Checks the length.
What is a User Interface?
The space where interaction between humans and machines occur.
What are the two types of User Interfaces?
- Textual User Interface (TUI) - interaction through lines of text.
- Graphical User Interface (GUI) - interaction through graphical icons.
What are Cartesian Coordinates?
Positioning of something on a screen. (2D / 3D)
What are Arithmetic Operators?
They take numerical values as the operands, and produce a single numerical value.
What are the 5 types of Arithmetic Operators?
Addition, Subtraction, Division, Multiplication, Modulus
What are Relational Operators?
These operations compare two operands to determine their relationship, and evaluate to a Boolean value.
What are the 6 types of Relational Operators?
Equal to, Not equal to, Less than, Greater than, Less than or equal to, Greater than or equal to
What are Boolean Operators?
Used to manipulate True/False values in Boolean algebra
What are the three types of Boolean Operators?
NOT, AND, OR
What is a Subprogram?
A block of code that performs a specific task.
What are parameters?
Variables within a function.
What are arguments?
The data that is passed on into subprograms.
What are the two types of subprograms?
Functions (returns a value) and Procedures (may/may not return a value)
What are libraries?
Collections of additional subprograms that often tackle more complex and specific tasks.
What are pre-existing subprograms?
Subprograms that have been coded by someone else and are often pre-compiled
Why are pre-existing subprograms useful? (4 benefits)
- Perform generalisation (decreases complexity)
- Ability to reuse code
- Decomposes a problem
- Saves time
What are the two types of variables?
Global Variables and Local Variables
What are Global Variables?
Variables declared outside of a subprogram and can be accessed anywhere from a program.
What are Local Variables?
Variables declared within a subprogram and can only be accessed there.