Computer Science IGCSE paper 2
Computer Science IGCSE paper 2
Can be used for: medical records; search engines store data about websites; online
shops store product data; in schools data stored about students; libraries store book
data.
Advantages: electronically:
- Data easily stored in a specific way.
- Data found quickly.
- Data Filtered to retrieve only required.
- Data easily shared over internet or portable storage device.
- Data can be validated.
- Back-up copy can be made.
- Saves space compared to paper database.
- Database structure:
Table- structure in which data is stored
Flat file database- records stored in single table.
Record- collection of data about one single item (line).
Field- piece of data about an item (column).
- Primary keys: a unique identifier for each record in a field, inside a database.
- Flat file database: all data is stored in one large table.
- Relational databases: a database that has several tables linked by primary key fields.
- Index: a list of values or items.
- Foreign key: a primary key that appears in another table in a relational database.
● Programming Concepts:
- Variable: a storage location of a named value that contains data that can be changed
throughout a running program, can be used repeatedly throughout a program.
- Constant: a storage location of a named value that does not change during the
running of a program.
- Basic principles:
Algorithm: a set of instructions to solve a problem.
Sequence: instructions that occur one after another in a particular order.
Executed: a program that is run.
Selection: making a choice or decision in a program.
Interaction: repeating instructions in a program.
Condition loop: a state in a program where instructions will be met or not met.
Counting loop: a set of instructions set for a number of times.
Totalling: creates a total of something for a variable that can be updated.
Counting: a variable is counted when values are added to the count.
- Array: a way of storing data that is all related and of the same type. Can be accessed
by referring to its location within it, each individual element has a location that can be
pointed to (these start at 0).
To create an array u need a variable that will store the array name, set the number of
elements the array will hold (specifying dimensions; once designed cannot be
changed) and define the type the array will hold.
- .append() = adds element.
- .clear() = clears the list.
- .copy() = returns a copy of the list.
- .count() = returns number of values in list.
- .extend() = extend list with other values.
- .index() = returns the index of the first element.
- .pop() = removes value at specific position.
- .remove() = removes item with specific value.
- .reverse() = reverses order of list.
- sort() = sorts the list.
- .update() = adds several items to the list.
● Pseudocode and Flowcharts: are tools that a programmer may use to help design a
program or understand one.
Comments: are written to state what a particular line or section of code is for. (#)
Variables: is a named location in memory that holds a data value (may change).
Arrays: a data structure that holds a collection of values of the same data type,
can be one dimensional or two dimensional (table). (between
parentheses). Tuple (ordered, unchangeable), sets (unordered, unindexed {}),
dictionaries (unordered, changeable, indexed {}).
- .fromkeys () = returns dictionary with specified keys and values.
- .get () = returns value of specifies key.
- .items () / .keys () = returns the key of item specified.
Counting: method to keep a record of how many times something has happened, variable
used to hold value of count that may be added or subtracted.
Totalling: process of keeping a running total of certain values in a program, value used to
hold the value of the total.
Selection: a statement that represents choice in an algorithm.
> greater than
< smaller than
Is a program that allows a program to follow different paths, the choice >= greater than or
of path is determined with conditions, whether they’re met or not. equal to
Condition- a state in a program that will be met or not <= smaller than or
equal to
IF...THEN...ELSE...ENDIF != not equal to
CASE...OF...OTHERWISE...ENDCASE (more specific than IF). == equal to
% what remains of
CASE Number_of_Pets
Procedures: a small section of code that can be run repeatedly from different parts of the
program, they do not return a value, all run using the CALL statement.
PROCEDURE...ENDPROCEDURE
- Test data:
Normal (typical) - data that the code would be expected to expect. (If an integer
between 1-100 is expected, a number is expected to be entered.
Extreme data - also expected to expect, but within the boundary set.
Invalid (erroneous) - data that the code should not accept. (Entering a letter when a
number is expected, then an error message should appear).
Range check - specifies bounds that the data entered must be in (numerical).
Val:
Presence check - makes sure the field has data in.
Type check - specifies that only a certain type of data can be entered.
Lookup - Provides the user with a drop-down list to select data.
Length check - specifies that data entered has to have a certain number of
characters.
Ver: Double entry - the user enters the data twice. Computer checks if they both
match, if not they ask for the user to re-enter the data (passwords).
Twin entry - two users enter the same data separately. Computer checks to
see that both entries match, if not computer asks use to re-enter the data.
Proofreading - one user enters the data and the second user reads it, if okay
the data is accepted, otherwise the second user amends the data and then
submits it.
- Trace tables: a table used to trace the values of variables through the execution of the
program.
- Dry run: paper based run through an algorithm or program.
- Syntax error: an error occurs because the programmer does not use the correct
language structure in a program.
- Logic error: an error that causes a program to do something unexpected.