Cs Edexcel Notes
Cs Edexcel Notes
1.1 Algorithms
1.1.1
Variable: A ‘container’ used to store data. Values stored are not fixed.
Identifier: A unique name given to a variable or a constant.
Constant: A ‘container’ that holds a value that never changes. They have unique identifiers.
Arithmetic operator: An operator that performs a calculation on two numbers.
1.1.2
Construct: A component from which something is built. Letters and numbers are the
construct we use.
Selection:
o A construct that allows a choice to be made between different alternatives.
o Represented using an IF….THEN….ELSE statement.
o This statement allows a choice to be made between two alternatives.
o Relational operators are also used to compare two values.
o Nested selection: consists of one or more IF statements placed inside each other. Two possible
courses of action.
Iteration:
o A construct that means the repetition of a process. An action is repeated until there is a desired
outcome or a condition is met. Also known as a loop.
o Definite iteration: Used when the number of iterations, or turns of the loop, is known in
advance. It can be set to as many turns as you want. It is count controlled.
o Indefinite iteration: used when the number of iterations is not known before the loop is started.
The iterations stop when a specified condition is met. It is condition controlled.
o Logical operator: A boolean operator using AND, OR and NOT.
o Nested loop: A loop that runs inside another loop. The inner one executes all of its instructions
for each of the outer loop.
Sequence: An ordered set of instructions.
Concatenation: The linking together of two or more items of information.
1.1.3,4,5,6
1.1.7,8,9
Arrays:
o An organised collection of related values that share a single identifier.
o All sorting and searching algorithms work on lists of data.
Bubble sort:
o Uses an algorithm design that does not include any techniques to improve performance.
o When data is sorted, different items must be compared with each other and moved so that they
are in ether ascending or descending order.
Starts at one end of the list and compares each neighboring number.
If they are in the wrong order they are swapped and keeps doing this until the list is in ether
ascending or descending order.
This process is repeated until there are no swaps left to be done during a pass.
Merge Sort:
o A sorting algorithm that divide a list into two smaller lists then divided these until the size of
each list is one.
o Recursion: Repeatedly applying a method to the results of a previous application of the
method.
o Uses the ‘divide and conquer’ method.
Liner search:
o Works by checking each element to see if it matches the target.
o Repeats until a match is found or the whole list has been checked.
o A linear search is sequential.
Binary search:
o Uses a ‘divide and conquer’ method.
o In a binary search the middle item in a list is repeatedly selected to reduce the size of the list to
be searched.
o To use this method the list must be sorted into ascending or descending order.
The choice of algorithm depends on the data that is to be processed.
1.2.1
Computational thinking: The thought process involved in formulating problems and their
solutions so that the solutions are represented in a from that can be effectively carried out by
a computer.
Decomposition: Breaking a problem down into smaller, more manageable parts, which are
easier to solve. A technique of computational thinking.
Abstraction: The process of removing or hiding unnecessary detail so that only the important
points remain. A technique of computational thinking.
Subprograms: A self-contained module of code that performs a specific task. It can be
‘called’ by the main program the it is needed.
When designing a solution to a problem the inputs, outputs and processing requirements
should be identified at the outset.
Chapter 2 : Programming
A program is an algorithm that has been converted into program code so that it can be
executed by a computer. A well-written algorithm should be free of logical errors and easy
to code in any high-level language.
Syntax error: An error that occurs when a rule of the programming language is broken.
When algorithms are converted into programs the computer needs to be told what type of
data is stored in each variable. Every programming language has a number of built-in data
types.
Data type: Specifies what kind of data it can hold. Common data types are integer, real,
Boolean and character. The data type of a value determines the operations that can be
performed upon it.
Variable initialization:
o When a variable is declared, the computer allocates it a location in memory. Initially this
location is empty, so before a variable can be used it has to be given a value.
o Once a variable has been initialized an assignment statement is used to change its value.
o Assignment statement: The SET….TO command is used to initialize variables in pseudocode.
Type coercion: The data type variable gets changed during program execution. The process
of converting the value stored in a variable from one data type to another.
Command sequence: A set of instructions that the computer executes one after another in
order. Usually combined with loops ad selection statements.
Selection: Used to create a branch in a program. The computer selects which branch to
follow based on the outcome of a condition.
Loops: Another name for an iteration. Used to make a computer repeat a set of instructions
more than once.
The four basic data types are integer, float/real, Boolean and character.
Variable and type decelerations, command sequences, selection and iteration are four of the
structural components of a program.
Technique
Description
Comments
Used to explain what each part of the program does.
Descriptive names
Using descriptive identifiers for variables, constants and subprograms helps make their purpose
clear.
Indentation
Makes it easier to see where each block of code starts and finishes. Getting the indentation
wrong can result in the program not running.
White space
Adding blank lines between different blocks of code makes them stand out.
Proving readable code makes it easier to understand what a program does and how it does it.
2.3 Strings
String: A sequence of characters. They can be letters, numbers, symbols, punctuation marks
or spaces.
String indexing: Each character in a string has an index number, with the first character at
position 0. You can use the index to reference individual characters in a string.
Length:
o LENGTH function used to find the number of characters in a string.
o Function: A subprogram that performs a specific task and can be used at any point in the
program.
String traversal: Using a loop to cycle through each character in a string. Can use a FOR
loop.
Concatenation: Involves joining two or more items of information together, Concatenating
two strings produces a new string object.
Type conversion: Performed when a string and a non-string are joined together. The
computer converts the non-string into a string before joining the two strings together.
Slicing: The process of extracting part of a string.
String formatting: Used to control the way text is displayed on screen.
Data structure: An organised collection of related elements. Arrays and records are two
common data structures used in programming.
One-dimensional arrays: A list of elements, each of which has a unique index value
representing its position in the list.
Two-dimensional arrays: A matrix of rows and columns resembling a table.Two indices are
used, one to reference the rows and the other the columns. All the elements of a two
dimensional array share the sam data type.
All the elements in an array have the same data type.
A record consists of a collection of fields. The values stored in a record can be of different
data types.
2.5 Input/Output
Validation: To check that the data entered by a user or from a file meets specified
requirements. Any program that requires data entry should have appropriate forms of
validation built in.
Range check: Used to ensure that data is within a specified range.
Length check: Used to ensure that data has a length within a specified range.
Presence check: Used to ensure the user has entered some data.
Look-up check: Used to ensure the data matches one of the values in a predefined list.
Who user are required to choose from a list of options, their inout should be validated to
ensure that their choice is valid.
Large sets of data are normally stored in text files. The advantage of writing data to a file is
that the data is not lost when the program is terminated. It can be read format he file
whenever it is needed.
2.6 Subprograms
Subprogram:
o A self-contained module of code that performs a specific task.
o Using subprograms reduces the complexity of programs and makes them easier to understand.
o There are two types of subprograms : functions and procedures.
o Procedures: A subprograms contains a set of statements that are executed when the procedure
is called. Unlike a function, a procedure does not return a value to the main program.
o Functions: A subprogram that returns a value to the main program.
Abstraction: The process of removing or hiding unnecessary detail so that only the important
points remain.
The two variables that store the random number generated by the function:
o Local variable: Can be accessed only from within the subprogram in which it is created.
o Global variable: Can be accessed from anywhere in the program, including inside
subprograms.
Built-in functions: Functions that are provided in most high-level programming languages to
perform common tasks.
Procedure: A subprogram that does not return a value to the main program.
Parameters: Values that are passed to a subprogram when it is called.
Testing: This is the only way ensuring that the program functions correctly and meets all of
the specified requirements.
Evaluating programs: Need to able to identify the strengths and weaknesses of the programs
as well as those created by other programmers and identifying areas for improvement.1
Runtime errors: An error that occurs while the program is running - the operation the
computer is asked to do is impossible to execute.
Logic errors occur when there is an error in the logic of the code, causing the program to
produce an unexpected result.
Syntax error: Occurs when part of the code breaks the rules of the programming language.
Runtime error: Occurs while the program is running and it is asked to do something that is
impossible.
Truth tables: Can be used to manually trace the execution of an algorithm, allowing you to
track the changes in variable values.
Chapter 3: Data
3.1 Binary
Binary: Information represented by only two values. There are no communication errors or
misunderstandings because there are no small differences. It is needed to represent data and
program instruction because of the way in which computer work.
A system with separate states is said to be digital and if there are two states it is binary.
Digital: Information represented by certain fixed values.
A system such as this, where there is a continuous range between two values, is said to
be analogue.
Analogue: Using signals or information represented by a quantity that is continuously
variable.
Representing information
o There are only two digits, 1 and 0, bu to represent the symbols in text there must be at least 52
separate items of information - 26 lower-case and 26 upper-case letters.
o In a similar way the two binary digits (bits) can be combined into groups.
o Binary digits: The smallest unit of data that is represented in a computer. It has a single binary
value, either 1 or 0.
Number systems
o Binary is a number system based on two digits, 0 and 1.
o The difference is that the denary system works in powers of 10, whereas the binary system
uses powers of 2.
Denary system
o Every digit has a value and the one to the left has a value 10 times higher that the one to to the
right.
Binary system
o The binary system has similar place value but they increase by powers of 2.
o Byte: The basic combination of bits used to represent an item of information. A byte typically
consists of 8 bits.
Binary arithmetic
o Binary numbers can be manipulated in the same way as denary ones.
Denary addition
o When addition is performed n denary, a ‘carry over’ is used if the result is greater than 9.
o Binary addition works int he same way but a ‘carry over’ is needed if the result is greater than
1.
Binary addition
o We are adding eight-bit numbers and this has caused a problem. All eight bits have been used
and the 1 that was carried over in the last column has nowhere to go - it has been carried out.
o Therefore the result of the calculation would be wrong. This is called an overflow error.
o This condition occurs when a calculation produces a result that is greater than the computer
can deal with or store.
o The processor is informed that an error has occurred.
Signed and unsigned numbers
o When an integer is indicated as being positive or negative it is described as being signed.
o Sign and magnitude
In a multiple-bit binary number, the left-most it, the one with the greatest value, is called the most
significant bit (MSB). We can use this to represent signed integers.
Two’s complement
o The most common method used to represent signed integers in modern computers is two’s
complement.
o This method works on the principle above-the result of any number added to its negative
equivalent should be zero.
Computers
4.2 Hardware
4.3 Logic
Truth tables: A table showing all possible combinations of the inputs and outputs of an
operator.
Boolean: Something that can take only the values True or False; named after English
mathematician George Boole.
Logic circuit: An electronic circuit that has inputs and outputs that follow one of the
Boolean operators.
AND, OR and NOT are called logical or Boolean operators. They are used in selection
statements such as IF.
The order of precedence is: brackets, NOT, AND, OR.
4.4 Software
5.1 Networks
Disadvantages
Ring topology
Advantages
Disadvantages
Adding extra devices does not affect the performance of the network
Whole network will fail if the cable is cut or damaged or a device on the network fails
Star topology
Advantages
Disadvantages
A damaged cable will stop the whole network from working, just the network device connected
to it
Easy to locate faults because they will normally only involve one device
Expensive to install due to amount of cable needed and the hub or switch
Advantages
Disadvantages
Very fault tolerant, especially in the case of a fully connected mesh network — if one device
fails, messages can be rerouted
In a wirless mesh network each node extends the range of the network
Advantages
Disadvantages
o Wireless connectivity
Advantages
Disadvantages
A wider range of devices can communicate with each other/a network because it is not
dependent on having the correct table.
Unit
Abbreviation
bps
kbps
1,000
Mbps
1,000,000
Gbps
1,000,000,000
Protocols: A set of rules that govern how communications on a network should be formatted
and what data they should include.
Email protocols
o Simple Mail Transfer Protocol (SMTP): Used when sending email through the internet.
o Post Office Protocol, Version 3 (POP3): Current version of Post Office Protocol that is used
for retrieving email from an email server.
o Internet Message Access Protocol (IMAP): Allows emails to be accessed using multiple email
clients.
Network protocols
o Ethernet: Family of protocols that are used in wired LANs. Physical parts of a network.
o Wi-Fi: A digital communications protocol that sets out how data is transmitted on wireless
LANs.
o Transmission Control Protocol (TCP): Provides a reliable connection between computers.
o Transmission Control Protocol/Internet Protocol (TCP/IP): A protocol stack, a collection of
protocols that work together.
Layer
Description
Application
The top layer of the stack. Layer which interacts with the user to provide access to services and
data is sent/received over a network.
Transport
This layer manages end-to-end communication over a network. There are two main protocols
that operate at this layer - TCP and UDP
Internet
This layer deals with sending data across multiple networks, from the source network to the
destination network.
Link
This layer controls the transmission and reception packets of data to/from a local network.
o HyperText Transfer Protocol (HTTP): Used when sending and receiving data between web
browsers and web servers.
o HyperText Transfer Protocol Secure (HTTPS): The secure version of HTTP.
o File Transfer Protocol (FTP): Used to transfer files over a network that uses TCP protocol,
such as the internet.
Network security: Activities designed to protect a network and its data from threats such as
viruses, hacker attacks, denial of service attacks, data interception and theft.
Access control: This determines which users have access to which data, and what they are
allowed to do with it.
Firewall: A network security system that monitor and control data that is moving from one
network to another.
Physical security: Controlling access to critical parts of a network using physical methods
rather than software.
Authentication is the process of checking the identity of someone trying to use a computer
system.
Cloud storage is storing data using a third party, usually in a system connected to the
internet.
A cyberattack is any kind of electronic attack on a computer system, server, network or
other IT device.
Many different measure need to be taken to prevent cyber attacks from being successful.
These start at the design stage of system and include keeping systems up to date, training
staff and proactively testing security if the network regularly.
Some of the materials used in the manufacture of computer components are non-renewable
and in short supply. Others are dangerous and pose a risk to human health.
The Restriction of Hazardous Substances (RoHS) Directive restrict the use of hazardous
materials in computing technology, forcing producers to find more environmentally friendly
alternatives.
Computing technology consumes huge amounts of energy. Data centres are on of the worst
culprits.
Energy efficiency measures and use of renewable energy can significantly reduce the carbon
footprint of computing technology.
There is a possible health risk, especially for children, from exposure to the electromagnetic
fields generated by wireless devices, such as smartwatches and smart clothing.
Unregulated disposal of e-waste in landfill sites poses a significant threat to the
environment.
The Waste Electrical and Electronic Equipment (WEEE) regulations set targets for
responsible recycling of e-waste.
Computing technology is helping to preserve the environment in a number of ways,
including monitoring and modelling climate change, conservation and smart energy.
6.2 Privacy
Computing technology enables organisations to gather, store and analyse vast quantities of
personal information about the people they come into contact with.
Individuals give away all sorts of personal information about themselves online.