Computer Science Revision Notes
Computer Science Revision Notes
● Data and Information Data can consist of facts or statistics out of the context and used for analysis. It
can be numbers, characters, symbols or images that are processed by a
computer.
Information can be a sentence of words, a sequence of number or a series of
images that have been put into a context, which is what gives the data meaning.
● Constants and Variables Variables are used in computer programming to store specific values within a program.
They are assigned both a data type and a value. Some values are stored permanently; the
data is constant. Other things are always changing; the data is variable.
Variables are data entities whose values can be altered.
Constants are data entities whose values cannot be altered.
● Understanding different A data type determined the actions that can be performed on data when it is
data types held within a program or field of a database or a spreadsheet.
The most common data types are called primitive data types.
The different primitive data types are explained below:
● Integer: An integer data type deals with whole numbers. A member of
the set of positive whole numbers, negative whole numbers and zero.
● Real: A real data type contains numeric data in a decimal
● Boolean: The Boolean data type represents values of true/false or
yes/no. The primitive data type of a Boolean is logical. There are
arithmetic tests that can be used to create Boolean values. They are <,
<=, ==, !=, >= and >
● String: A string is a data type that can contain a set of characters,
numbers and spaces.
● Character: A character type may contain a single letter, digit,
punctuation mark, symbol, formatting code, control code, or some other
specialised code.
● Data structures What is a data structure?
A data structure is a specialized format for organizing and storing data. General
data structure types include the array, the file, the record, the table, the tree,
and so on. Any data structure is designed to organize data to suit a specific
purpose so that it can be accessed and worked with in appropriate ways.
BY SUHAYL PATEL
2
name. This means that a program can be written to search through the data
structure much more quickly than having to write a new line of code for every
variable. This reduces the complexity and length of the program which makes it
easier to find and debug errors.
● Program Flow Control Program flow control can be defined simply as the order in which a program is
executed
Advantage of using it when designing programs
● It decreases the complexity of the task at hand, as everything is
completed in a logical manner and so the program should take less time
to code
● This logical structure also means that the code has increased clarity and
so faults can be recognised quicker and more easily
● It also means that many programmer can work on one program, as the
structure has already been planned and is fairly standards. This also
means in an increase in productivity.
Representing structure:
Flow charts can be used to plan programs and represent structure
The four main symbols used in making flow charts are shown below:
This shows the start of a process
and has only one output
This represents an operation
carried out. This blocks must have
exactly one input and one output.
This represents a question with
only two answers so it always
makes a Boolean choice. It has one
input and two outputs.
This is the opposite of the ‘start’
symbol. It only has one input
On the other hand, algorithms can also be used. An algorithm is a series of
instructions that solves a problem in a finite number of steps that always ends.
The basic building blocks of coded solution are sequencing, selection and
iteration. They are explained below:
● A sequence is a set of instructions acting in order, meaning that each
action follows the previous action.
● A selection control structure involves a choice. Usually, a program’s
execution path is determined by statements.
● An iteration control structure involves repeating actions. It involves a
statement that is executed in a loop until its criteria are met.
BY SUHAYL PATEL
3
● Procedures and A procedure is a block of code that performs a task without returning a value.
functions A function is very similar to a procedure except that it returns a value. There are
two types of functions;
Procedure and functions are subroutines that feature in all programming languages.
They are named blocks of code that can be used and re-used to perform specific
tasks. Their purpose is to allow the repetition of certain sections of a program or
calculation many times.
BY SUHAYL PATEL
4
Error Handling:
You must understand that some errors can be detected and corrected during the
coding stage. You must also understand that some errors will occur during the
execution of the code.
The process of testing a program for errors during the execution of code is a cyclic
activity called debugging.
Debugging can also be enhanced with the aid of tools. Some of these tools are
stated below:
● Watch:
o As the name implies, this essentially ‘watches’ any variable specified
by the programmer
o They show its contents relative to the line that the program is
currently executing
● Breakpoints:
o These can be added to the code by the programmer which will halt
the program’s execution when it reaches that point
o They allow the program to test the code at those points
● Step:
o Allows the programmer to continue the program’s execution on a
line-by-line basis, to see what is changed on each line
● Use of an Integrated Development Environment/IDE
● Syntax colouring
● Code completion
● Automated/Integrated testing
● Compiler/interpreter
●
Some errors can be detected before even making the code. This is called dry-run
testing. It is usually carried out on the algorithm which is written in pseudo-code or
as part of a flowchart. The main advantage to dry-run testing is that it enables
programmers to spot errors even before they start writing code.
Trace Tables:
A trace table is used to test algorithms to see if any logic errors occur while the
algorithm is being processed.
● Systems You must know what a computer system is. It is hardware and software working
together to create a working solution. In its very basic form, a computer can be
looked as nothing more than an input, a process, some storage, and an output.
Hardware is the machines, wiring, and other physical components of a computer or
other electronic system.
Software is the programs and other operating information used by a computer.
BY SUHAYL PATEL
5
● They improve quality of life, e.g. those without limbs can have then replaced
with bionic
● They help save lives, e.g. emergency response teams can coordinate rescues
quicker
Reliability in computer systems is vitally important. High reliability is when a
computer system can be depended on to work almost all of the time. Robustness is
also vital. Robustness is the ability of a computer system to cope with execution
errors or abnormalities.
Both are important as high reliability and robustness mean that the computer
system can be depended on at all times without any chance of failure
If a system is not reliable or robust then the user may not be able to use the
program when required, which, depending on the situation, could have severe
consequences.
One way computer systems are made reliable is the duplication of each component
in a system or the whole system itself, so that if there is an error, there is always a
backup to replace them in case they stop working.
● Hardware Hardware is the machines, wiring, and other physical components of a computer or
other electronic system.
The fundamental pieces of hardware required to make a functioning computer
system are stated below:
● CPU: The ‘central processing unit’ undertakes instructions it receives from
programs in what is called a cycle.
● Motherboard: This links the CPU to the memory and other hardware.
● Graphics Card: They contain a processor like the CPU and can be used to
process the graphic portion of the processing load.
● Hard Drive: This store the majority of your data. The hard drive unit houses
the hard disk, where the data is physically stored.
● ROM (read only memory): ROM is non-volatile. The computer’s BIOS/ Initial
instructions/bootstrapping instructions are stored in the non-volatile
memory in a computer’s main memory.
● RAM (random access memory): RAM is volatile. When a program is opened,
it get loaded from the hard drive into the RAM, because reading data from
RAM is much quicker, making the program’s use quicker.
In all computer systems there are also input and output devices. These are essential
for computer systems to work well with a user.
BY SUHAYL PATEL
6
● CPU (central processing The CPU undertakes instructions it receives from programs in what is called a cycle.
unit) and Motherboard The CPU has a number of cores. The speed of a CPU is measured in how many cycles
it can perform in a second. This is regarded as clock speed. The name given to one
cycle per second is a Hertz. A CPU’s control unit performs the following instructions:
● Fetch instructions
● Decode instructions
● Execute instructions
● Store results.
BY SUHAYL PATEL
7
The main differences between mobile and non-mobile processors are described
below:
● Clock Speed: Lower clock speeds mean the amount of heat produced is less.
Therefore phones have lower clock speed processors.
● Due to less space in portable devices, other components are integrated with
the processor, like the wireless networking components.
● Mobile processors are also optimised for low power consumptions.
A motherboard links the CPU and PU’s to the memory and other hardware. The CPU
uses the motherboard to receive and send signals to components, such as the hard
drives (storage). Motherboards have buses (circuits) that connect one part of the
motherboard to another. The speed of the bus is measured in Megahertz. The more
data the motherboard bus can handle at any one time, the faster the system.
● Memory There are two main categories of chip-based memory: volatile memory and
non-volatile memory. Data and instructions are stored in memory and processed by
the CPU in order to produce a desired result or output.
ROM (read only memory): ROM is non-volatile. The computer’s BIOS/ Initial
instructions/bootstrapping instructions are stored in the non-volatile memory in a
computer’s main memory.
RAM (random access memory): RAM is volatile. When a program is opened, it get
loaded from the hard drive into the RAM, because reading data from RAM is much
quicker, making the program’s use quicker.
Cache Memory: Cache memory is the memory closest to the CPU. All the recent
instructions are stored in cache memory as it is very fast. A cache memory often has
a small access time, whereas the access time from the main memory is larger. Cache
memory is very expensive and hence is limited in capacity.
BY SUHAYL PATEL
8
Explain why having cache memory can improve the performance of the central
processing unit (CPU):
● Frequently used data/instructions are stored in the cache
● Meaning they don’t have to be fetched from main memory.
● Therefore data/instructions stored in the cache memory can be accessed
faster than data stored in the main memory.
BY SUHAYL PATEL
9
● Difference: Solid state media can be more compact than magnetic media.
Explanation: The smaller size enables better mobility;
You must know how to use binary to represent whole numbers up to 255.
BY SUHAYL PATEL
10
Always remember to draw this table when converting binary to denary or denary to
binary.
128 64 32 16 8 4 2 1
You must know how to convert between binary, denary and hexadecimal.
When converting denary to Hexadecimal, use the following table.
0 1 2 3 4 5 6 7 8 9 1 1 1 1 1 1
0 1 2 3 4 5
0 1 2 3 4 5 6 7 8 9 A B C D E F
ASCII:
Characters are represented in binary using ASCII or other character conversion
systems. ASCII has some limitations. The total number of characters that can be
encoded in ASCII is 128 Characters.
Explain the possible limitations of using ASCII character set for global
communication:
● ASCII is a 7-bit character set so can include at most 128 different characters
● These 128 characters represent mainly just the Latin alphabet
● And so this means that the characters of many other alphabets/languages
cannot be represented.
BY SUHAYL PATEL
11
The software development life cycle is a structured procedure used for developing
● Software Development new software products:
Cycle ● Step 1 – Requirement Analysis
o At this stage the programmers, designers and the clients discuss the
needs of the user so it is clear what is required
● Step 2 – Design
o Here the solution is planned, using the specification discussed in the
previous section
● Step 3 – Implementation
o In this section the designs are turned in code
o This is usually the longest phase
● Step 4 – Testing
o During this phase the code written during the implementation
section is tested against the specification, to ensure the code
written really provides a solution to the problem
● Step 5 – Evolution
o These are changes/upgrade that the software goes through after it
is delivered to the client
o This stage can only occur if the programmers bear this is mind
during the design and the implementation stages, as the software
needs to be coded to allow future changes to be made
There are several lifecycle models that can be used. Some of these are cyclical,
waterfall, and the spiral model.
Cyclical Model: This model is explained above and it is more of a generic model.
● Advantages:
o Clear defined stages.
o Simple to understand and use.
o Well understood milestones.
o Easy to arrange tasks.
● Disadvantages:
o It’s difficult to measure progress within stages.
o Cannot accommodate changing requirements.
o No working software is produced until late in the cycles
o Risk and uncertainty is high with this process model
BY SUHAYL PATEL
12
place to determine if the project is on the right path and whether or not to continue
or discard the project. Unlike what I mentioned in the general model, phases do not
overlap in a waterfall model.
● Advantages:
o Simple and easy to use.
o Easy to manage due to the rigidity of the model – each phase has
specific deliverables and a review process.
o Phases are processed and completed one at a time.
o Works well for smaller projects where requirements are very well
understood.
● Disadvantages:
o Adjusting scope during the life cycle can kill a project
o No working software is produced until late during the life cycle.
o High amounts of risk and uncertainty.
o Poor model for complex, object-oriented and long projects.
o Can be difficult to go back a step if needed.
o Poor model where requirements are at a moderate to high risk of
changing.
Spiral Model: The spiral model has four phases: Planning, Risk Analysis, Engineering
and Evaluation. A software project repeatedly passes through these phases in
iterations (called Spirals in this model). The baseline spiral, starting in the planning
phase, requirements are gathered and risk is assessed. Each subsequent spirals
builds on the baseline spiral.
● Advantages:
o High amount of risk analysis
o Good for large and mission-critical projects.
o Software is produced early in the software life cycle.
o More client consultation
o Ability to return and fix problems.
● Disadvantages:
o Can be a costly model to use.
o Risk analysis requires highly specific expertise.
o Project’s success is highly dependent on the risk analysis phase.
o Doesn’t work well for smaller projects.
● Prototyping
Prototyping offers people who have an interest in a system the capability of
evaluating the proposed designs, rather than having to interpret those designs on
some other means such as descriptions.
Advantages of prototyping:
● It allows the customer and the developer to compare if the developed
software matches the software specification according to which the
program should have been built.
● It can offer improvements to the quality and definition of customer
BY SUHAYL PATEL
13
Disadvantages of prototyping:
● Prototypes are limited in functionality and may not scale well if they are
used as the basis for a final product.
● Users can become attached to functionality that was included in a prototype
for consideration and then removed from the specification for the final
system; this can lead to conflict.
● Prototyping is supposed to be carried out quickly. Some developers may try
to produce complex prototypes.
● Prototyping is expensive.
● Application Testing Application testing is using the application in controlled condition to see how it
works
● Rigorous testing is essential for coded solutions as it determines whether or
not the developers have met the specification outlined at the start of the
software development life cycle
● It also ensure that the end user’s (those who will operate the software)
experience is not affected by bugs and errors, which make the evolution
phase easier as less has to be done
Test plans
● These are documents created before the testing phase of the software
developmental life cycle outlining what tests will occur and how they will be
conducted
● They should show the methods used and the anticipated results
● The details outlined in these plans must be quantifiable and measureable
Types of tests:
● Unit Testing: Unit tests or modular tests are performed by the programmer
as they are developing the program. They test the correctness of small
blocks of code in isolation.
o Advantages of unit testing:
▪ Problems are discovered early.
▪ Integration testing is easier.
▪ Acts as documentation of the system.
▪ Extremely accurate unit test coverage.
▪ The unit test itself is used to verify the design.
o Disadvantages of unit testing:
▪ Time consuming.
▪ Does not show absence of errors.
▪ Hard to set up realistic, useful tests.
BY SUHAYL PATEL
14
● System Testing: System testing takes place after the code has been
individually tested and is done without having to have any knowledge of the
code itself. This tests that the entire system functions correctly
● Non-functional Testing: This tends to reflect the quality of the product,
particularly the suitability of the application from the point of view of the
client. A load test investigates software behaviour during increasing system
loads and a performance test is carried out to investigate the processing
speed and response time for specific scenarios.
● Functional testing: This is testing in normal conditions. This tests to ensure
that the software is in line with all of the specifications outlined by the
client. Usually, the software should have been built for this type of data.
BY SUHAYL PATEL
15
Networks can be organised in different formats. These formats are called network
topologies.
Bus topology: In this network configuration all of the clients, servers and resources
are connected to one cable (the bus). When a device communicates, the message is
transmitted down the bus that all devices receive, but only the intended recipient
accepts and processes the message
● Advantages of the bus topology:
o It is easy and cheap to install as a consequence of requiring only a
small quantity of cable.
o It is suitable for small networks.
● Disadvantages of bus topology:
o The cable length is limited. This restricts the number of devices that
can be connected to the network.
o As more devices are connected, the performance of the network
becomes slower as a consequence of data collisions.
o All workstations see all data – so there is a security risk.
Ring topology: In this topology, each device is connected to two other devices which
forms a ring for the messages to travel around. When a message is sent in a single
direction it is received by each device until the intended recipient receives it.
● Advantages of the Ring topology:
o Data is transferred quickly as data only flows in a single direction so
there are no data collisions
● Disadvantages of Ring topology:
o Workstations often see data not intended for them – so there is a
security/privacy risk
o If any of the cable fails or a device is faulty then the whole network
will fail.
o Alterations or maintenance to the network nodes can impact the
performance of the while network.
Star topology: Most home network use this topology as it has a central connection
point that could be a hub, switch or router.
● Advantages of the Star topology:
o They are reliable as if one cable or device fails then the other
devices will be unaffected
o They are high performing as no data collision occur.
o Changes to one client do not affect the others.
● Disadvantages of Star topology:
BY SUHAYL PATEL
16
● Client server The client-server model is the structure of a computer network in which many
clients request and receive services from a centralised server.
For computers to work together they have to use protocols. A protocol is a set of
rules which governs the transfer of data between computers.
When two computers first connect in a network they use a handshake. Handshaking
establishes which protocols to use and controls the flow of data between the two or
more connected computers.
Handshaking process:
1. A request to connect is sent.
2. A connection is granted
3. Protocol parameters are greed.
● Web Application Server-side programming is writing code that runs on the server, using languages
concepts supported by the server (such as Java, PHP, C#; it is possible to write code that
executes on the server-side in JavaScript). Client-side programming is writing code
that will run on the client, and is done in languages that can be executed by the
browser, such as JavaScript
Server-side programming:
● Retrieving data from a database.
● Populating a page with the latest details.
BY SUHAYL PATEL
17
Client-side programming:
● Validation rules
● Flash games
● Cookies
● Advertising
● Responsive design
● Use of external code External code sources are sources that are not designed specifically by a user, but
sources has a generic purpose. These can be free or even cost money.
BY SUHAYL PATEL
18
● Database Concepts Relational databases consist of more than one table that are linked using key fields.
A relational database has three main components; a store, a method of creating and
retrieving data, and a method of ensuring that the data is logically consistent.
Possible situations when a text file would be a better choice than a relational
database:
● When the data can be edited by users
● When the data to be stored does not need the overhead of a relational
database.
● Could save memory space if data is not large.
● Query Methods (SQL) Query - this is a question posed to the database. This is done using SQL. SQL
(Structured Query Language) is a programming language designed to manage
data with a relational database.
BY SUHAYL PATEL
19
● Connecting to By storing data in web-based databases, new web technologies have led to
databases from web ‘distributed applications’.
applications and web Distributed application programs have many parts that are stored on different
based apps. virtual machines. The different virtual machines can be on the same or even
different systems, allowing smartphones to access the same resources as desktop
computers.
Web-based software is usually paid for on a subscription or usage basis, allowing
companies to pay only what they need and to grow into the system without large
upfront costs.
Client-server software is usually paid for upfront and the initial cost of the system
can be high.
Client server applications have advantages over web-based applications.
● You are in control of upgrades.
● You have to manage your own systems and pay for technical support.
● Applications tend to run faster when they are local to the user’s computer.
● The use of computer Our lives are fully integrated into a computer science world of mobile devices, tablet
technology in society computers, desktops and laptop computers.
Every day social media is changing the way we communicate and interact. It even
plays an important motivational role in getting people involved in political and social
debates.
The advances in technology have also revolutionised medical treatments, and
microprocessors can now even be used to control artificial limbs.
Most devices are becoming web enabled, which means that they are connected to
each other by the internet.
BY SUHAYL PATEL
20
The term digital divide is the gap between people who can access technology and
people who cannot. This could be as simple as a person being able to buy things
cheaper online than someone without the technology but also refer to countries
that have no easy access to the internet and all it offers in terms of education and
knowledge.
BY SUHAYL PATEL