Isaac Cs Gcse Book 2022
Isaac Cs Gcse Book 2022
Isaac CS Team
Contents
1 Network fundamentals . . . . . . . . . . . . . . . . . . . . . 1
2 The internet . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
3 Network hardware . . . . . . . . . . . . . . . . . . . . . . . . 9
4 Boolean logic . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
5 Systems architecture . . . . . . . . . . . . . . . . . . . . . . 19
6 Memory and storage . . . . . . . . . . . . . . . . . . . . . . 27
7 Hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
8 Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
9 Operating systems . . . . . . . . . . . . . . . . . . . . . . . 47
10 High- and low-level languages . . . . . . . . . . . . . . . . . 53
11 Translators . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
12 Social engineering . . . . . . . . . . . . . . . . . . . . . . . . 62
13 Malicious software . . . . . . . . . . . . . . . . . . . . . . . 67
14 Network security . . . . . . . . . . . . . . . . . . . . . . . . . 70
15 Representation of numbers . . . . . . . . . . . . . . . . . . . 76
16 Representation of text . . . . . . . . . . . . . . . . . . . . . 89
17 Representation of images . . . . . . . . . . . . . . . . . . . . 95
18 Representation of sound . . . . . . . . . . . . . . . . . . . . 100
19 Compression . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
20 Encryption . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
21 Database concepts . . . . . . . . . . . . . . . . . . . . . . . . 114
22 SQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
23 Data structures . . . . . . . . . . . . . . . . . . . . . . . . . 126
24 Searching algorithms . . . . . . . . . . . . . . . . . . . . . . 132
25 Sorting algorithms . . . . . . . . . . . . . . . . . . . . . . . . 145
26 Legislation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
27 Impacts of technology . . . . . . . . . . . . . . . . . . . . . . 156
28 Programming concepts . . . . . . . . . . . . . . . . . . . . . 158
i
ii CONTENTS
▶ A star network topology is where all the nodes are arranged in a star
layout and connected to a device at its centre point. What is the name
of the device at the centre of the star which can direct the signals to their
intended recipients only?
▶ Below are statements that highlight some of the differences between client–
server and peer-to-peer networking. Pick one statement that is not correct.
1
2 1. NETWORK FUNDAMENTALS
A local hospital has a computer network that uses a bus network topology.
It is finding that the network is slow and is taking too long to retrieve patient
records. They have been advised to create a mesh network.
▶ For which of the following reasons is a mesh network the correct choice?
1.5 Ethernet
AQA EDEXCEL OCR WJEC isaaccs.org/bq/gcse_net_17
⃝ All Ethernet devices can process the data received from the router,
because they all use the same protocols.
⃝ Ethernet is a method to connect computers to a network using a wire-
less router.
⃝ Ethernet is a group of networking technologies commonly used in local
area networks.
⃝ Ethernet routers use the same set of protocols.
⃝ Transport layer
⃝ Application layer
⃝ Network or internet layer
⃝ Link or data link layer
5
6 2. THE INTERNET
When data is sent across a network it is broken into packets, each with their
own control information.
▶ Which of the following pieces of data are not part of a data packet?
⃝ Sender’s IP address
⃝ Receiver’s IP address
⃝ Checksum
The TCP/IP networking model is split into four layers. Each of these layers
has a specific purpose and supports different protocols (rules for communic-
ation). The four layers are:
1. Application layer
2. Transport layer
□ UDP
□ IP
□ Wi-Fi
□ HTTP
2.6 IP addresses
AQA EDEXCEL EDUQAS OCR WJEC isaaccs.org/bq/net_internet_g01
▶ Why do all devices that connect to a network or the internet need a unique
IP address?
2.7 Protocols
AQA EDEXCEL EDUQAS OCR WJEC isaaccs.org/bq/net_internet_g02
▶ Complete the table by adding the correct layer or protocol into the spaces
so that each protocol matches the layer at which it operates.
Layer Protocol
Application
TCP
Internet
Ethernet
□ Frame
□ Wireless
□ CAT4
□ Transport
□ Link
□ HTML
□ IP
□ HTTP
□ Packet
3 Network hardware
Network hardware is the term used for all of the hardware components that
can be found in computer networks. This includes the network inter-
face controllers, that are used to connect individual devices to a network,
and components such as switches and routers, that are used to build the
backbone of the network.
Devices can be connected by cable or wirelessly. Many networks have both
wired and wireless connections.
⃝ Coaxial cable
⃝ Wi-Fi
⃝ Fibre-optic cable
9
10 3. NETWORK HARDWARE
□ Router
□ Fibre-optic cable
□ Switch
4 Boolean logic
Computers are made up of digital circuits. Each component in a circuit
has an input voltage that can be evaluated as True or False, or 1 or 0.
Boolean logic is a way of describing the circuits inside a computer, and
the same concept can be represented by a logic circuit diagram, a truth
table, or a Boolean expression.
At a more advanced level, you will study more complex logic gates, although
all circuits can ultimately be derived from the combination of a small subset
of basic gates. Using a formal notation for describing the combination of
logical operations will allow you to apply standard rules to simplify complex
Boolean expressions. You will explore some standard circuits in detail, such
as a full adder, which allows arithmetic addition, and a D-type flip-flop
circuit, which is a very basic unit of memory.
▶ Is the output (D) of the circuit above T or F when all its inputs (A, B,
C) are T?
Answer:
11
12 4. BOOLEAN LOGIC
⃝ NOR
INPUT INPUT OUTPUT
0 0 1 ⃝ NOT
0 1 0
1 0 0 ⃝ NAND
1 1 0
⃝ XOR
▶ Circle the correct truth table for the logic gate represented by the following
symbol.
A B OUTPUT A B OUTPUT
0 0 0 0 0 0
0 1 1 0 1 1
1 0 1 1 0 1
1 1 1 1 1 0
A B OUTPUT
0 0 0 A OUTPUT
0 1 0 0 1
1 0 0 1 0
1 1 1
4. BOOLEAN LOGIC 13
A watering sprinkler (W) is on when the timer (T) is set, the temperature
(C) exceeds 26◦ Celsius, and the rain sensor (R) does not detect rainfall.
A B
C D
Answer:
14 4. BOOLEAN LOGIC
▶ Fill in the missing values in the truth table for the logic circuit diagram
below, given the following inputs:
A B C D E
0 0 0 0 0
0 0 1 0 0
0 1 0 1 0
0 1 1 1 1
1 0 0 0
1 0 1 1 1
1 1 0
1 1 1 1 1
4. BOOLEAN LOGIC 15
A B
C D
Answer:
16 4. BOOLEAN LOGIC
A truth table is a table showing the outputs for all possible combinations of
inputs to a logic gate or circuit. When putting values into a truth table, we
often write them as 1 or 0. These values are interchangeable with True and
False: 1 is True, and 0 is False.
Below we have an example of a logic gate:
▶ Circle the truth table that represent the logic gate provided:
A B Q A B Q
0 0 1 0 0 0
Option A 0 1 1 Option B 0 1 1
1 0 1 1 0 1
1 1 1 1 1 0
A B Q A B Q
0 0 1 0 0 1
Option C 0 1 0 Option D 0 1 1
1 0 0 1 0 1
1 1 0 1 1 0
4. BOOLEAN LOGIC 17
The following symbol represents an XOR gate (also known as Exclusive OR).
▶ Circle the correct truth table for an XOR gate from the options shown
below.
A B Q A B Q
0 0 1 0 0 1
Option A 0 1 1 Option B 0 1 0
1 0 1 1 0 0
1 1 0 1 1 0
A B Q A B Q
0 0 0 0 0 0
Option C 0 1 1 Option D 0 1 1
1 0 1 1 0 1
1 1 0 1 1 1
Inputs Output ⃝ X ∧ ¬Y
X Y Q
0 0 0 ⃝ ¬(X ∧ Y )
1 0 1 ⃝ X ∨ ¬Y
0 1 0
1 1 0 ⃝ ¬X ∧ Y
18 4. BOOLEAN LOGIC
Inputs Output ⃝ ¬X ∧ Y
X Y Q
0 0 0 ⃝ X ∨ ¬Y
1 0 1 ⃝ X ∧Y
0 1 1
1 1 0 ⃝ X ⊻Y
▶ Which logical operator has been used in the following truth table to pro-
duce output Q?
▶ Which logical operator has been used in the following truth table to pro-
duce output Q?
5.1 Hardware
AQA EDEXCEL EDUQAS OCR WJEC isaaccs.org/bq/embedded_systems_g_01
▶ Embedded systems are often part of a larger computer system. From the
options below, select 3 that describe the hardware components of embedded
systems.
⃝ A desktop computer
⃝ Raspberry Pi
⃝ A washing machine
⃝ A laptop
19
20 5. SYSTEMS ARCHITECTURE
▶ Which one of the following CPU components is used to reduce how long
the processor has to wait for data and instructions?
⃝ Cache
⃝ Bus
▶ Which one of the following statements describes the decode stage of the
fetch-decode-execute cycle?
⃝ The control unit (CU) works out what the instruction is about.
⃝ The results of the calculations that took place are stored back to the
main memory.
⃝ The arithmetic and logic unit (ALU) carries out the instruction.
⃝ Dishwasher
⃝ ALU
⃝ Register
⃝ Control unit
⃝ Bus
▶ When comparing two processors which are identical except for the clock
speed - which of the following statements will be true about the processor
with the higher clock speed?
5.9 Tick-tock
AQA EDEXCEL EDUQAS OCR WJEC isaaccs.org/bq/gcse_sys_16
▶ The clock is used to synchronise the operations of the processor. Its speed
is measured in cycles per second, and expressed in hertz (Hz), where 1Hz is
one cycle per second. My computer system has a published processor speed
of 3.3 GHz. How many cycles per second is my processor designed to operate
at?
⃝ 3,300
⃝ 3,300,000,000
⃝ 3,300,000
⃝ 3.3
□ The instructions are loaded into main memory from secondary storage
□ The data required for the instructions has been loaded into main
memory
□ The user must enter their password to give permission for the instruc-
tions to be executed
□ The instructions are translated into machine code that the processor
can understand
⃝ The fetch-decode-execute cycle uses the the arithmetic logic unit (ALU)
to connect the registers to the main memory.
□ The program counter keeps track of the memory address of the instruc-
tion that needs to be executed next.
□ The memory address register holds the address in main memory that
is currently being read or written.
□ The accumulator is a data register that can be used to store the results
of calculations.
□ The memory data register holds data fetched from memory or data
waiting to be stored in memory.
5.15 Registers
AQA EDEXCEL EDUQAS OCR WJEC isaaccs.org/bq/sys_arch_g02
⃝ Temporarily holds the data (data values or instructions) that are read
from or written to the main memory.
⃝ Temporarily stores the memory addresses used when searching for data
in RAM.
5. SYSTEMS ARCHITECTURE 25
⃝ Option A
Computer specification
Clock speed 3.6GHz
⃝ Option B
Computer specification
Clock speed 1.2GHz
⃝ Option C
Computer specification
Clock speed 4.6GHz
⃝ Option D
Computer specification
Clock speed 3.5GHz
26 5. SYSTEMS ARCHITECTURE
⃝ Central Heating
⃝ Laptop
⃝ Microwave
⃝ Digital clock
⃝ Medical Equipment
⃝ Vending Machine
6 Memory and storage
Computers have two fundamental types of memory — main memory and
secondary storage. Main memory is where data and instructions are stored
so that they can be accessed directly by the CPU. Secondary storage is
used to permanently store data such as the operating system and the user’s
files.
⃝ RAM is used to store the BIOS which is used when the computer is
started.
⃝ RAM is used to store instructions and data that the processor can
directly access.
⃝ The hard disk drive (HDD) is made up of RAM so that data can be
permanently stored.
▶ Select four from the following statements about memory that are true:
□ ROM can store the code needed to load the operating system into
RAM
□ Virtual memory uses secondary storage to store data from the RAM
27
28 6. MEMORY AND STORAGE
6.3 Back-up...
AQA EDEXCEL EDUQAS OCR WJEC isaaccs.org/bq/gcse_data_14
Marik is about to back-up his mobile phone data. The back-up storage app
on his phone is reporting the following values in GB (gigabyte):
Description Size
Photos 17.25 GB
Documents 3.25 GB
Messages 21.25 GB
Other data 2.75 GB
⃝ 5,500,000,000 bytes
⃝ 5,000,000,000 bytes
⃝ 5,000,500,000 bytes
⃝ 44,500,000,000 bytes
▶ Arrange the below units of data storage into order from smallest to largest.
□ 8000 MB
□ 9 TB
□ 7.8 GB
□ 5.7 kB
□ 2000 bits
□ 200 bytes
6. MEMORY AND STORAGE 29
Tia is calculating the amount of disk storage that her bitmapped graphic
will use. She has calculated that the total file size in bits as 12, 200, 000.
▶ How many megabytes of storage space will the file need?
⃝ Hard drives are usually physically smaller than solid state drives, which
means that they have less capacity for backing up data.
⃝ Hard drives can be difficult to manufacture.
⃝ It is significantly slower to access data stored on a hard drive than on
a solid state disk because the hard drive has moving parts, such as the
read/write head and the rotating platters.
⃝ Hard drives are prone to scratches because they have a moving read/write
head, and this can make parts of files unreadable.
30 6. MEMORY AND STORAGE
▶ Put the statements below into order to create one paragraph about the
characteristics of RAM and then the characteristics of ROM.
□ RAM
□ ROM
▶ Select three of the following statements about optical storage that are
true:
□ Optical media isn’t easily portable due to the internal moving parts
▶ Pamela has a 128GB USB flash drive that is 60% full. How many video
files can she store on the flash drive if each file is 25.6MB? Assume 1kB =
1000 bytes.
32 6. MEMORY AND STORAGE
Laura has planned to go hiking in Snowdonia. She wants to take photos and
videos of her trip with her digital camera and then show them to her friends,
but her camera is running out of space.
▶ Which type of storage is the most suitable in this case?
▶ Which storage device would you recommend so that Laura does not run
out of storage?
Cache memory is typically split into three levels. These levels have slightly
different characteristics and enable the processor to save frequently used
instructions.
▶ The levels have different access speeds. Number them in order from the
fastest (1) to access to the slowest (3).
□ Level 1
□ Level 2
□ Level 3
▶ The levels of cache also have different storage capacities. Number them
in order from the largest (1) to the smallest (3).
□ Level 1
□ Level 2
□ Level 3
6. MEMORY AND STORAGE 33
▶ In recent years, the use of cloud storage has greatly increased. Which three
of the following characteristics are important reasons to use cloud storage to
store files?
□ Sharing files
□ Expandable storage capacity
□ Safe back-ups
□ Speed of access
□ Cost
▶ There are many types of main memory, used for a variety of purposes.
Which of the following is most often the highest capacity memory device
inside a computer?
⃝ Registers
⃝ RAM
⃝ Cache
⃝ ROM
34 6. MEMORY AND STORAGE
Miguel works for a video production company and needs to clear up some
space on his computer.
□ Speed of access
□ Portability
□ Reliability
□ Capacity
□ Cost
⃝ Solid-state storage
⃝ Magnetic storage
⃝ Optical storage
⃝ Cloud storage
6. MEMORY AND STORAGE 35
Rosa has just graduated from university and her mother was there to capture
it on video.
Now Rosa’s family wants to see the video to celebrate with her. Many family
members have asked Rosa to send them a copy of the video so they can share
in her triumphant moment. However, Rosa has lots of relatives and not all of
them have access to an internet connection. They all have access to storage
connections such as a USB and CD drive. The video is only a few megabytes
in size.
□ Speed of access
□ Portability
□ Reliability
□ Cost
□ Capacity
⃝ Optical storage
⃝ Magnetic storage
⃝ Cloud storage
⃝ Solid-state storage
36 6. MEMORY AND STORAGE
His company has offered to pay for a new storage device if it will help Mads
do his work, so money is no concern. The program is quite large and complex.
□ Speed of access
□ Capacity
□ Cost
□ Portability
□ Reliability
⃝ Optical storage
⃝ Solid-state storage
⃝ Cloud storage
⃝ Magnetic storage
7 Hardware
Hardware is the word used for the physical components of a computer
system. Hardware can refer to the internal parts of the computer (mother-
board, CPU, and RAM), or external devices, known collectively as peri-
pherals. Peripheral devices can be used to input data (keyboards, mi-
crophones, scanners), output data (monitors, printers, speakers), or to store
data (external hard drives, USB memory sticks).
7.1 PCBs
EDUQAS WJEC isaaccs.org/bq/sys_hard_g01
⃝ CPU
⃝ Fan
⃝ Graphics card
⃝ Keyboard
⃝ Mouse
⃝ Trackpad
⃝ Touchscreen
37
38 7. HARDWARE
⃝ 3D printer
⃝ Inkjet printer
⃝ Plotter
⃝ Laser printer
⃝ RAM
⃝ Bus
⃝ CPU
7. HARDWARE 39
▶ Put the devices into the correct position in the table to match their pur-
pose.
Purpose Device
Uses one or more pens to draw an image. Pens are
lifted or applied to the paper as required to
produce very precise drawings.
Generates sound waves from data being received
from a sound card. Often built into a computer
system, but can also be connected as external
peripherals.
Allows for three-dimensional designs on a
computer to be printed in a solid form. The device
uses filament, usually in the form of plastic-based
resin, which is heated and printed layer by layer to
form a solid object.
Prints a whole page at a time and is typically
capable of printing hundreds of pages per minute.
This device uses powdered ink called toner.
Uses liquid ink to produce black-and-white or
coloured prints. Liquid ink produces rich colours,
meaning it is the most suitable for printing
photographs.
□ Laser printer
□ Plotter
□ 3D printer
□ Speaker
□ Inkjet printer
40 7. HARDWARE
RFID tags are made up of an antenna — for receiving and transmitting the
radio frequency signals — and a chip, which processes the signals. Each
tag has a unique identifier and will often store some additional data in a
non-volatile memory cell.
▶ Read through the statements below and put the words provided into the
correct places to fill the gaps.
Active systems have a small battery within the tag, and the device will
items. The tags are deactivated or removed when the goods are paid for. A
□ power supply
□ radio energy
□ chip
□ identifier
□ battery-powered
□ reader
7. HARDWARE 41
▶ Using the table below, state whether each of these components of a smart-
phone is an input, output, or both:
Feature Input/Output/Both
Speaker
Microphone
Touchscreen
Camera
⃝ Sip/puff switch
⃝ Keyboard
⃝ Touchscreen
42 7. HARDWARE
▶ Complete the table below by labelling each device as either input or out-
put.
⃝ Utility software
⃝ System software
⃝ Application software
43
44 8. SOFTWARE
⃝ Operating system
⃝ System software
⃝ Utilities
⃝ Users
The time required for users to download a file can be reduced by using
□ encryption
□ compression
□ defragmentation
⃝ Compression
⃝ Defragmentation
⃝ File repair
⃝ Encryption
8. SOFTWARE 45
▶ Complete this sentence by adding the missing word into the space provided.
plain text.
▶ Complete this sentence by adding the missing word into the space provided.
⃝ Encryption software
⃝ System cleanup tools
⃝ A directory of known viruses
⃝ Corrupt data
▶ Which of the following tasks is not one of the roles of the operating
system?
⃝ Malware protection
⃝ Memory management
⃝ Processor management
9.2 Multi-tasking
AQA EDEXCEL EDUQAS OCR WJEC isaaccs.org/bq/sys_os_role_of_os_g02
47
48 9. OPERATING SYSTEMS
▶ Which four of the tasks below are carried out by the operating system?
□ Deletes emails
9. OPERATING SYSTEMS 49
▶ Complete the table by adding a tick to identify what actions are managed
by each function and a cross to identify what actions are not managed by
each function.
They need access to the school’s computer system in order to see lesson
resources.
▶ What level of access would be appropriate for the school to give the
student?
⃝ Write
⃝ Modify
⃝ Read
50 9. OPERATING SYSTEMS
Add the correct label into the corresponding position in the table:
□ Windows □ Menus
□ Pointer □ Icons
9. OPERATING SYSTEMS 51
To allow the user to interact with the computer, an operating system provides
a user interface (UI). There are various forms that a UI can take.
▶ Correctly match the UI to the image that represents it using the following
options; Command line interface (CLI), Natural language interface
and Graphical user interface (GUI).
52 9. OPERATING SYSTEMS
Function Definition
Determines how much memory to allocate to
each process.
Allocates time to processes that are deemed
urgent.
Swaps tasks in and out of the processor so it
appears the computer is doing more than one
task at the same time.
□ Interrupt
□ Memory manager
□ Scheduler
10 High- and low-level languages
Most programming languages that you will have heard of are high-level lan-
guages. Python and C# are examples of high-level languages that are widely
used in education and in the workplace. A high-level language is one that
is user-oriented in that it has been designed to make it straightforward for
a programmer to convert an algorithm into program code.
A low-level language is machine-oriented. Low-level programs are ex-
pressed in terms of the machine operations that must be performed to carry
out a task. This makes writing programs more difficult, as the algorithm
must be specified in terms of the capabilities and specifications of the pro-
cessor. Low-level languages are named for the processor (or processor family)
that they are designed for, and are often referred to as assembly language
or machine code.
⃝ High-level language
⃝ Low-level language
53
54 10. HIGH- AND LOW-LEVEL LANGUAGES
▶ Label the statements below showing the characteristics of low- and high-
level programming languages by adding High level or Low level into the
last column.
Characteristic Label
Use syntax similar to human language
Require specific knowledge of a processor
and its operations
Must be compiled and converted into
machine code before they are run
Typically used to control specific hardware
Have built-in libraries that the
programmer can call upon
Are easier to learn and understand
Sometime use a set of mnemonics for key
commands
▶ Blake is developing an app for their Computer Science school project and
the teacher has suggested they use a high-level language to do this. What
would be the three best reasons for this suggestion?
INP
STA 99
INP
ADD 99
OUT
HLT
10010000001
00111100011
10010000001
00011100011
10010000010
00000000000
56 10. HIGH- AND LOW-LEVEL LANGUAGES
▶ Below are some examples of programming tasks. Add the correct type of
language to use for the task (high- or low-level) into the table.
Example Classification
Creating a mobile app to track the amount of
water people are drinking
Writing a program for a embedded system
that measures the moisture in a greenhouse
Creating a device driver for your custom
keyboard
Creating a 3D video game for your friends
Creating a motion-controlled light with a
microcontroller
□ Machine code
□ C Sharp
□ Assembly language
□ Python
58 10. HIGH- AND LOW-LEVEL LANGUAGES
▶ Below are some statements about assembly language. Use the words
provided to complete the sentences.
an assembler.
□ binary
□ English
□ machine code
□ assembling
□ translating
□ mnemonics
11 Translators
A translator is a piece of software that handles the translation of source
code into a form that can be executed by a processor. Interpreters, com-
pilers, and assemblers are all types of translator. Depending on the situ-
ation, you will need to use different types of translators. You will also explore
the multiple stages of translation between source code and object code.
□ Semantic analysis
□ Syntax analysis
□ Code optimisation
□ Code generation
□ Lexical analysis
⃝ Compiler
⃝ Interpreter
⃝ Assembler
59
60 11. TRANSLATORS
□ You have to wait until the entire program is translated before receiving
any errors.
□ If you want to change something in the program, you have to translate
the whole program again.
□ The source code must be given to the user.
□ The source code is translated line by line while execution is underway,
so the program can run more slowly.
▶ Which stage of the compilation process ensures that the tokens follow the
rules of the programming language being used?
⃝ Lexical analysis
⃝ Syntax analysis
⃝ Semantic analysis
11. TRANSLATORS 61
□ Only an executable file is given to the user, not the original source
code.
One of their customers has recently had their login details stolen as they
accidentally entered their username and password into a fake website that
looked identical to the website of the real bank. By accident, they had
entered the following URL https://oceansavings.com.
⃝ Phishing
⃝ Pharming
⃝ Blagging
⃝ DDoS attack
62
12. SOCIAL ENGINEERING 63
▶ From the list provided, select the two indicators of a phishing email:
□ Email sent at unexpected time of day (i.e. outside of the normal work-
ing day)
▶ The table below provides definitions for common social engineering tech-
niques. Choose from the words below to match the technique to the defini-
tion.
□ Phishing
□ Blagging
□ Pharming
□ Shouldering
Tech- Definition
nique
An attack in which the victim receives a message disguised to
look like it has come from a reputable source (for example, a
bank), in order to trick them into giving up personal
information.
An attack in which the perpetrator invents a scenario in
order to convince the victim to give them personal
information or money.
Deceiving users by sending them to a fake website that the
user believes is the real one, with the intention of tricking
them to submit personal data.
64 12. SOCIAL ENGINEERING
⃝ Shouldering
⃝ Blagging
⃝ Pharming
⃝ Phishing
⃝ Phishing
⃝ Pharming
⃝ Shouldering
⃝ Blagging
12. SOCIAL ENGINEERING 65
⃝ Blagging
⃝ Shouldering
⃝ Pharming
⃝ Phishing
Martha has received an email that appears to be from Amazon saying that
she has won a £500 Amazon gift card. To claim the voucher, she needs to
fill out a form with her name, address, date of birth, and Amazon account
username.
Martha is not good with computers but she does think this email could be
too good to be true. She shows the email to her daughter who advises her
to delete the email and block the email account.
▶ Based on the given scenario, which type of social engineering attack has
Martha been a potential victim of?
⃝ Shouldering
⃝ Pharming
⃝ Phishing
⃝ Blagging
66 12. SOCIAL ENGINEERING
or user IDs.
Users need to be vigilant and aware of how to spot these forms of at-
□ authentication
□ Social engineering
□ Phishing
13 Malicious software
Malicious software (malware) is created with the intent to cause damage
to computer systems or steal data, and computer users must take steps to
lessen these threats. There are many different forms of malware, some of
which can be classified as viruses, trojans, and worms based on how they
behave. These are explained further in the sections below.
Different forms of malware have different purposes. Spyware, for example,
can be used to track your use of computer systems, and keyloggers can
capture and transmit any data that you enter into a computer system.
Ransomware, by contrast, prevents a user accessing their computer files.
Fortunately, for every threat, there is a form of defence. It is essential that
everyone who uses a computer recognises how their system can be exposed
to threats, and understands the importance of keeping software up to date
and regularly scanning for malware.
▶ Using the statements provided, match the form of attack to the correct
description.
□ Worm
□ Virus
□ Trojan
67
68 13. MALICIOUS SOFTWARE
Spyware is a type of malicious software that leaks data back to the creator, a
is a type of spyware that records keys pressed to discover
passwords and confidential information.
□ trojan □ keylogger
□ worm □ self-replicating
□ malicious □ virus
□ Anti-malware software
□ Patching
□ Code review
13. MALICIOUS SOFTWARE 69
Farah was using her laptop to complete some online research for her home-
work when the following message popped up on the screen:
⃝ Virus
⃝ Ransomware
⃝ Spyware
⃝ Trojan
▶ What would be the two best methods to prevent this type of attack and
its impact?
□ Regular backups
□ Security patches
□ Anti-malware software
14 Network security
Computer networks are a part of everyday life, and many of us connect to
some kind of network on a regular basis. You may keep much of your data
“in the cloud” or use online banking to manage your money. Several online
stores may have a record of your card payment details.
Networks contain so much valuable data and, unfortunately, there are many
criminals who would love to get their hands on it. If the network is connected
to the internet, criminals can hack accounts and launch cyberattacks from
anywhere in the world. This means that they can be hard to track down
and hard to prosecute.
Access to networks can be controlled by ensuring that users have strong pass-
words, and by setting appropriate access rights for authorised users. Codes
of conduct and acceptable use policies can be set to ensure that users follow
guidelines for keeping corporate data safe, and to hold them accountable if
they don’t. Backup systems and recovery procedures ensure that essential
data can be recovered if the worst happens.
It is good practice to use strong passwords, i.e. ones that are difficult to
guess. A long password is usually strong because it would take more attempts
to guess the password. However, other factors are also important.
⃝ I*saacC£S9
⃝ The name of your favourite football team combined with your date of
birth
⃝ zxcvbnm
⃝ flibbertigibbet123
70
14. NETWORK SECURITY 71
⃝ Password protection
⃝ Two-factor authentication (2FA)
⃝ Biometric authentication
⃝ Physical security
14.3 Filtering it
AQA EDEXCEL EDUQAS OCR WJEC isaaccs.org/bq/cyb_sec_g04
▶ Fill in the concept that correctly matches the description provided in the
table below.
Description Concept
Term used to describe the MAC addresses with
special rights or privileges.
Term used to specify the MAC addresses of
devices that are allowed to connect to the network.
Term used to specify the MAC addresses of devices
that are not allowed to connect to the network.
Security solution, although not very efficient, as it
is possible for a device to spoof an authorised
MAC address and gain access to the network
unnoticed.
□ Blocklist
□ Safelist
□ Whitelist
□ MAC filtering
72 14. NETWORK SECURITY
▶ Complete the table below by using the numbered statements to show the
differences between the symmetric and asymmetric encryption techniques.
2. The length of the keys used is larger, typically 2048 bits or higher
7. The private key is not shared, and the overall process is more secure
During his break, James crossed the street and went to the coffee shop to
have something to eat. As he was waiting for his order, he realised that he
had forgotten to send an important email to the accountancy department
with the company’s monthly financial balance. James tried to connect to the
internet using his mobile phone, but the company’s Wi-Fi security_guru
was out of range. However, the network secur1ty_guru_guests was
openly available, not requiring any type of authentication. So, James con-
nected to the network, finished writing the email with the financial balance
sheet attached, and sent it to the accountant’s office.
▶ Based on the scenario above, select all the options that represent what
James should or should not do to keep the company network safe from
cyberattacks.
The following describes some examples of how criminals explore human and
technical vulnerabilities to gain unauthorised access to data.
Human vulnerability
• Scanning for personal and work email addresses to identify friends and
colleagues
• Scanning for personal and work phone numbers to help identify linked
accounts and associates
Technical vulnerability
• Establishing a route to get back into the system easily in future should
this be required
• Covering tracks, so the means of access and activities carried out are
hard to determine even for an expert
The tester decides to use brute force methods and starts by trying to exploit
all the well-known software vulnerabilities to get access to the system infra-
structure. This type of test adopts a trial-and-error approach as the tester
has no information about the internal workings of the application used by
the company, nor about its source code or software architecture. As a res-
ult, this particular type of test would take a very long time to complete,
so the tester uses automated processes to help uncover the weaknesses and
vulnerabilities.
▶ Based on the above scenario and the approaches used by the tester, which
type of penetration test was used?
▶ The table below has base-2 place values. What is the value of the missing
place value?
16 8 4 2 1
128 64 32 16 8 4 2 1
0 1 0 1 1 1 1 1
Answer:
76
15. REPRESENTATION OF NUMBERS 77
143
128 64 32 16 8 4 2 1
53
128 64 32 16 8 4 2 1
▶ Add the following two 8-bit binary numbers together and provide your
answer in binary.
0 1 1 0 0 1 1 0
+ 0 1 1 1 0 1 0 1
=
78 15. REPRESENTATION OF NUMBERS
▶ Multiply the following 8-bit binary number by 8 and provide your answer
in binary.
000011012
Help your friend identify which part of their research is not accurate.
8 4 2 1 8 4 2 1
0 1 1 0 0 0 0 1
⃝ 61
⃝ F1
⃝ A1
⃝ 6A
8 4 2 1 8 4 2 1
⃝ 11110110
⃝ 11111110
⃝ 11110111
80 15. REPRESENTATION OF NUMBERS
8 4 2 1 8 4 2 1
▶ Step 2. Using the table above, state the hexadecimal value of the first
nibble.
▶ Step 3. Using the table above, state the hexadecimal value of the second
nibble.
⃝ 11111110
⃝ 01111111
⃝ 11111111
⃝ 11110111
15. REPRESENTATION OF NUMBERS 81
Reason True OR
False
It is easier to read and interpret
It uses more digits to represent the same value
Compared to binary, it is more likely that the digit will be
written down incorrectly
100010102
82 15. REPRESENTATION OF NUMBERS
Emily has picked her favourite colour for the background of her website. The
value of the colour in binary is 1010101011110000110100012 and it is too long
to remember! Help Emily by converting the number into hexadecimal.
15.17 Zombies
AQA EDEXCEL EDUQAS OCR WJEC isaaccs.org/bq/gcse_data_04
Maya is playing a video game involving zombie enemies. She wants to let
her team players know about a trap. Convert the following denary numbers
into hexadecimal and combine the answers to find out the secret message.
▶ Convert the denary numbers into hexadecimal and enter the message as
one word, without any blank spaces.
15. REPRESENTATION OF NUMBERS 83
0 1 1 0 1 1 1 1
+ 0 0 1 1 1 0 0 1
Which of the following base-10 and base-16 numbers has the most bits set
to 1 after the number is converted into binary?
▶ Convert the numbers into binary and select the number that has the most
1s.
⃝ 10010 ⃝ C516
⃝ 7910 ⃝ A216
Agneta has just received her latest monthly salary. She has done well this
month obtaining two bonus related payments and is putting the money to-
wards her holiday fund.
▶ The binary numbers below represent Agneta’s bonus payments. Can you
work out the total, in binary, of Agneta’s bonus?
Bonus 1 1 0 0 1 0 1 1
Bonus 2 + 1 0 1 0 1 0 0 1
—————————————-
Answer =
15.22 Convert it 1
AQA EDEXCEL EDUQAS OCR WJEC isaaccs.org/bq/gcse_data_20
15.23 Convert it 2
AQA EDEXCEL EDUQAS OCR WJEC isaaccs.org/bq/gcse_data_21
15.24 Convert it 3
AQA EDEXCEL EDUQAS OCR WJEC isaaccs.org/bq/gcse_data_22
15.25 Convert it 4
AQA EDEXCEL EDUQAS OCR WJEC isaaccs.org/bq/gcse_data_23
15.26 Convert it 5
AQA EDEXCEL EDUQAS OCR WJEC isaaccs.org/bq/gcse_data_24
15.27 Convert it 6
AQA EDEXCEL EDUQAS OCR WJEC isaaccs.org/bq/gcse_data_25
FF000016 FF000016
FF149316 FF149316
Option A Option B
FF7F5016 FF7F5016
FFE4B516 FFE4B516
FF000016 FF000016
FF7F5016 FFE4B516
Option C Option D
FFE4B516 FF149316
FF149316 FF7F5016
88 15. REPRESENTATION OF NUMBERS
When you add two binary numbers, you can use the same method as denary
addition: working from the right (the least significant bit), add up the bits
in each column with the same place value and, if there is a carry, add it into
the next column to the left (that with a higher place value).
▶ Perform the following calculation and select the option that correctly
illustrates the method of adding the two binary numbers.
110101012 + 000101012
⃝ Option A
Carry 1 1 1 1 1 1
1 1 0 1 0 1 0 1
⃝ Option B
Carry 1 1 1
1 1 0 1 0 1 0 1
⃝ Option C
Carry 1 1
1 1 0 1 0 1 0 1
⃝ Option D
Carry 1 1 1
1 1 0 1 0 1 0 1
16 Representation of text
All data on a computer system is represented using binary patterns, which
are sequences of 1s and 0s. In order to represent text, each individual letter
or character must be represented by a unique binary pattern. In order
to consistently represent characters from many different languages, these
patterns must be agreed throughout the world, through standards such as
ASCII and Unicode. Once you know how a letter is represented, you can
calculate the size of a text file and work out how much storage space is
required.
▶ The ASCII character code in denary (decimal) for 1 is 49, what would
the character code in denary be for the character 3?
89
90 16. REPRESENTATION OF TEXT
▶ A word has been encoded with ASCII character codes in denary. De-
code each character to form a three-letter word.
Lower-case letters a–z are represented by the ASCII character codes 97 to
122.
Decode this word: 98 105 116
16.4 Bit-patterns
AQA EDEXCEL EDUQAS OCR WJEC isaaccs.org/bq/data_rep_text_g04
▶ The standard ASCII code for the character 3 is 5110 . What is the ASCII
code for 9 in binary?
⃝ 001110012
⃝ 001110102
⃝ 01011012
⃝ 000010012
⃝ 01110012
16. REPRESENTATION OF TEXT 91
16.6 ASCII
AQA EDEXCEL EDUQAS OCR WJEC isaaccs.org/bq/data_rep_text_g05
⃝ 8 bits are used to store each character in the ASCII character set.
The number of bits used in a representation will affect the number of bit-
patterns available.
▶ Add the number of bit patterns into the table to correctly to show how
many bits are required to represent them.
2 3 4 5 6
Num-
ber of
bit pat-
terns
□ 16
□ 32
□ 8
□ 4
□ 64
□ 2
92 16. REPRESENTATION OF TEXT
numeric .
called a .
If you are using 4 bits, you can work out the number of bit-patterns by using
this formula:
4 bits: 24 = bit-patterns
You can also take a look at the binary place value headings.
□ 8
□ Bit-patterns
□ character code
□ character set
□ unique bit-pattern
□ 16
16. REPRESENTATION OF TEXT 93
arrows, etc.
□ 128
□ 4
□ 26
□ 7
□ 8
94 16. REPRESENTATION OF TEXT
□ There is a Unicode character set that uses only 8 bits per character.
16.11 Characters
AQA EDEXCEL EDUQAS OCR WJEC isaaccs.org/bq/data_rep_text_g06
▶ The bit pattern used for each character becomes a numeric character code.
Which of the following are characters?
□ Letters
95
96 17. REPRESENTATION OF IMAGES
▶ What is the total file size (excluding any metadata)? Give your answer
in bits.
17. REPRESENTATION OF IMAGES 97
Calculate the storage capacity required for a bitmap image with the dimen-
sions 1024 x 768 pixels that has 256 different colours. Then, work out the
file size in kBs if the file metadata takes up 20% extra space. Present your
answer as a real number, including the values after the decimal point.
▶ What is the storage capacity required? Give your answer in kBs.
▶ A bitmapped graphic uses a colour depth of 3-bits and this allows for 8 dif-
ferent colours. If the number of different colours that need to be represented
increases to 30, what is the minimum new colour depth required?
98 17. REPRESENTATION OF IMAGES
Naga has made an icon for a maze solving game she has created. The icon
has been created as a bitmapped graphic. It is 32 pixels wide and 32 pixels
high and uses 9 different colours.
▶ What is the total file size (excluding any metadata)? Give your answer
in bits.
Image files contain metadata which can be described as “data about data”.
When Zoe looks at the properties of one of her photos, she sees the following
information that has been extracted from the file metadata:
Property Value
Manufacturer Canon
Model EOS 250D
Date and time 2021:04:06 14:31:00
Geolocation 53.61766, -2.1552
Pixel X dimension 2240
Pixel Y dimension 1680
Flash Flash did not fire
▶ Which of the items of metadata (from the list shown) is needed to accur-
ately display the image to someone who wants to view the photo? Select all
that apply.
A graphic designer wants to use sound in her client’s animation. She has
composed a sound that is one minute in length and recorded in stereo sound.
The sound was sampled using a 16kHz sampling rate and an 8-bit sample
resolution.
A researcher uses a sonar to look for whales and dolphins. The sonar emits a
sound signal that makes it possible to detect objects at a reasonable distance
underwater. The sonar system operates at a sampling rate of 400kHz, with
a sample resolution of 16 bits.
▶ What is the minimum storage required to store one hour of data received
by the sonar in its uncompressed form?
⃝ 3TB ⃝ 300MB
⃝ 300GB ⃝ 3GB
100
18. REPRESENTATION OF SOUND 101
18.6 Jamal's CD
AQA EDEXCEL EDUQAS OCR WJEC isaaccs.org/bq/data_sound_06_g
▶ During an exam, you are required to calculate the size of a 10-second mono
sound file with a sampling rate of 16,000 hertz and a sample resolution of 8
bits. What would be the size of the file?
▶ Bob wants to share a sound recording of his favourite gig with his friends.
If the performance lasted 1 hour and the recording was made with a sampling
rate (frequency) of 15,000 Hz and a sample resolution (size) of 16 bits, what
is the minimum size of the audio file in gigabytes (GB)?
18. REPRESENTATION OF SOUND 105
If a music track is recorded in stereo, there are two sets of data (one for each
of the left and right channels). A track is recorded in stereo that lasts 3
minutes. The sample resolution is 14 bits and a sampling rate of 55kHz has
been used.
▶ Calculate the minimum stereo storage requirements needed for this stereo
music file, in its uncompressed form. Type your answer in megabytes
(MB). Assume 1MB is 1,000,000 bytes.
What is the storage capacity required for a song that is 5 minutes long and
was recorded using 20,000 samples per second and 8 bits per sample? The
file metadata takes up 10% extra space. Give your answer in MBs. Assume
1MB = 1,000,000 bytes.
▶ What is the storage capacity required? Give your answer in MBs.
19 Compression
Compression is a technique that reduces file size. Some compression tech-
niques are referred to as lossy, because they cause data to be lost dur-
ing the compression process. Other techniques are referred to as lossless,
because they allow the original data to be exactly reconstructed from the
compressed data. Different types of data lend themselves to different com-
pression methods. Popular compression methods include run length en-
coding, dictionary-based methods, and variable length (Huffman)
codes.
A game developer is creating a maze game and has used the bitmap below
as a background. Let’s say that they used RLE to compress the image and
used B for black and W for white. Row 1 would be compressed as B5, W1,
B1, W1, B5.
▶ How would row 12 be compressed?
106
19. COMPRESSION 107
A designer is developing a CCTV system that will monitor the flow of traffic
and pedestrians at traffic lights throughout a city. The file size of the CCTV
video footage is large and needs to be compressed to save on storage space.
□ Lossless compression
□ Lossy compression
Ultrasound machines are used in the medical field for diagnosis. During a
medical examination, part of the sound captured by the ultrasound machine
was digitised and converted into the following binary pattern:
▶ This data is compressed using RLE. Which of the following options would
be the correct result of the compression?
⃝ 0 0100 0 0010 1 0010 1 0100 1 0001 0 0011 0 0100 0 0100 0 0001 1 0011
1 0100
Option 1
19. COMPRESSION 109
Option 2
Option 3
Option 4
Answer:
110 19. COMPRESSION
Black and white pixels are used in the below image to show a bitmap image
of a Space Invader.
Run length encoding (RLE) can be used to compress the image. ▶ Put the
encoded lines into the correct order so that they represent the RLE for the
image. White is represented with a W and black is represented with a B.
□ W1, B6, W1
□ B8
□ B1, W6, B1
You‘ve asked Caesar what he wants to drink, but he doesn’t want everyone
else to know what he wants. He has sent you the following reply as an
encrypted message, along with a key value of 2.
ycvgt
Caesar has received an encrypted message from one of his soldiers. The
soldier has sent this message along with a key value of 8.
111
112 20. ENCRYPTION
20.3 Encryption
AQA EDEXCEL EDUQAS OCR WJEC isaaccs.org/bq/data_encrypt_g02
▶ Use the correct key words below to complete the following sentence:
▶ Use the correct key words below to complete the following sentence:
□ encryption
□ decrypt
□ same key
▶ Read all the sentences below and select one sentence that best describes
the keys used for symmetric encryption.
⃝ All the keys that are used in symmetric encryption are private.
more food
The soldier has encrypted and sent this message along with a key value of 7.
▶ Read all the sentences below and select one sentence that best describes
the keys used for asymmetric encryption.
⃝ All the keys that are used in asymmetric encryption are private.
⃝ An asymmetric encryption algorithm uses a pair of keys: a public key
and a private key.
⃝ Three public keys are used when using asymmetric encryption.
21 Database concepts
Data is fundamental to any computer system. With data comes the need
for a system that is able to store, sort, and search through it. Imagine
the amount of users a popular social media company has, then think about
storing every post they have made and the media that comes with it, such as
a video, image, or animated GIF. Without a database, you wouldn’t be able
to log in to access your posts, let alone be able to make connections with other
users and see their posts. In this section you will learn that databases can
be as simple as a single file, and as complex as a set of related tables, each
with fields and keys. It is important that data within a database is kept
up-to-date and consistent, and it is crucial to avoid storing the same data
in multiple places. At a more advanced level, you will learn that creating
an entity relationship model and designing a set of tables using the rules
of normalisation is important. Challenges arise when lots of users want
to access data simultaneously, and you will learn that transactions and
transaction processing are needed to ensure that the data does not get
out of sync.
114
21. DATABASE CONCEPTS 115
A local sports league needs to keep a record of the name of players and which
team they play for. Their database currently has three tables:
• The table Team contains the following fields: TeamID, TeamName, KitColour
• The table Registrations contains the following fields: RegistrationID,
PlayerID, TeamID, RegistrationDate
⃝ Address
⃝ PlayerID
⃝ DateOfBirth
⃝ FirstName
⃝ PlayerID, TeamID
⃝ RegistrationID, RegistrationDate
⃝ RegistrationID, PlayerID, TeamID
116 21. DATABASE CONCEPTS
Amelie provides a dog walking service and keeps all of the details of her
customers in a flat file database. A sample of the data she holds is below:
▶ From the choices below, choose the term that best describes the problem
with the data in this flat file database.
⃝ Data inconsistency
⃝ Data integrity
⃝ Data redundancy
22 SQL
SQL is short for Structured Query Language; it’s a language that is
used for constructing statements called queries to perform operations on
the data within a database. SQL operations include:
▶ The customer has recently downloaded another app called Flow Free. Use
the options below to complete the following query that will insert the new
download into the table.
□ INSERT
□ AppDownloads
□ VALUES
□ ‘Flow Free’
□ ;
117
118 22. SQL
▶ Complete the SQL query below using the words provided to update the
ListPrice of the property at 8 New Elvet, Durham to 330000.
_______________ Properties
<br >
_______________ ListPrice = 330000
<br >
_______________ PropertyID = 'Dur032 ';
<br >
□ UPDATE □ INSERT
□ WHERE □ SET
22. SQL 119
▶ When the following SQL query is executed, how many records will be
deleted?
⃝ 3 records
⃝ 2 records
⃝ 1 record
120 22. SQL
______________ Students______________
▶ Fill in the gaps above using the below options to complete the query:
□ *
□ ;
□ LastName
□ Team
□ YearGroup
□ FROM
□ WHERE
□ FirstName
22. SQL 121
A member of staff needs to know which Year 11 students are taking part.
Tick one box in each of the sections below to identify the correct SQL
statement to select the names and team for all year 11 students.
▶ Section 1
▶ Section 2
⃝ FROM database
⃝ FROM students
⃝ FROM Students
⃝ FROM table Students
▶ Section 3
Aleema has bookmarked the following films on a streaming service she sub-
scribes to.
FROM Films
▶ Complete the SELECT query above so that the films are ordered from the
highest rating to the lowest and Aleema knows which film to watch first.
□ FilmID
□ DESC
□ Rating
□ ASC
22. SQL 123
Dana has been looking at her app purchases. She wants to redownload an
app that she thinks she downloaded in November 2021. An extract from the
Downloads table is below:
▶ Choose the option that would complete the query below to help Dana find
the game.
1 SELECT *
2 FROM Downloads
3 WHERE ______________ ;
A buyer is using the agents’ website to find all available properties in Sun-
derland.
▶ Use the lines of code below to construct a SQL query that would return
the following fields for the buyer:
Not all lines of code provided are required to solve the problem
□ SELECT *
□ FROM Properties
□ FROM table
22. SQL 125
▶ Using the table above, which of the properties in the list below would be
returned when the follow query is executed:
1 SELECT PropertyID
2 FROM Properties
3 WHERE ( Bedrooms = 3 OR Bedrooms = 4) AND ListPrice <= 350000;
This two-dimensional array shows the data structure for storing words for
schoolchildren to learn their spellings.
Index 0 1 2 3
0 school pull where here
1 path floor sugar bread
2 accident answer eight critical
After the array has been created and saved as spelling_words in a program,
the following line of code is run:
PRINT(spelling_words[2,1])
▶ When the first index is the row number and the second index is the column
number, what will be the output on the screen?
⃝ answer
⃝ path
⃝ sugar
126
23. DATA STRUCTURES 127
23.2 Dictionary
AQA EDEXCEL EDUQAS OCR WJEC isaaccs.org/bq/dsa_datastruct_g02
□ key
□ value
□ data
23.3 Arrays
AQA EDEXCEL EDUQAS OCR WJEC isaaccs.org/bq/dsa_datastruct_g03
□ structure
□ items
□ same
□ instead
128 23. DATA STRUCTURES
▶ When discussing static data structures, which one of the following state-
ments is incorrect?
⃝ Memory is not wasted. The size of the array is declared for the number
of data items that will be added when the program is run.
⃝ If insufficient memory space has been allocated, the program may crash
or not work properly.
⃝ Memory is not wasted, for example, the elements are only declared for
the same amount of data items when the program is run.
⃝ True
⃝ False
23. DATA STRUCTURES 129
Mrs Smith loves to challenge people, so she gave the algorithm below as her
answer and told Mr Patel to use it to find the number of students.
Remember that the LEN() function will return the total number of items in
an array.
index and a .
□ two-dimensional array
□ row index
□ index number
□ row
□ data type
23. DATA STRUCTURES 131
in the list. A list is a ‘built-in’ data structure (or data type) in many pro-
gramming languages.
store data using a key and value system, just like a paper copy of a dictionary.
The word you are looking for is the and the definition
□ key
□ value
□ position
□ element
□ term
□ linear
24 Searching algorithms
Computers need to search through lists of data all the time; for example,
when trying to find a file with a particular name on your computer, or when
using a search engine to find websites on the internet that match certain
keywords.
When faced with the problem of searching for an item in a list of items,
you may have to deal with an unordered list. With an unordered list, the
only way to find a specific item is to look at every item in the list one after
another. This algorithm is called a linear search. If the list of items is
ordered, you can repeatedly split the list in half and check only the half in
which the item that you are searching for might be found. This algorithm
is called a binary search.
At a more advanced level, you will learn that these searching algorithms can
be implemented either iteratively or recursively. You will learn that a
binary search tree could also be used. You will also learn that the relative
complexity of each algorithm can be compared, to allow the best choice to
be made for a specific problem.
▶ Identify three reasons why you may choose to perform a linear search
rather than a binary search on a list of data.
132
24. SEARCHING ALGORITHMS 133
Tom sells knitwear via his website. He has a list with the number of products
that he’s sold in the last ten days. He wants to find out if there is a day that
he sold 22 products.
products_sold
11 16 17 22 25 30 35 46 57 72
Tom is using the binary search algorithm to search through the list of sales.
▶ Fill in the blanks with the values provided below to complete the steps
that a binary search will follow when searching for 22 in the products_sold
list.
Take the ordered list products_sold and the search item 22.
Initially, set the range of items where the search item might be found to be
the entire list.
Compare the item at the midpoint to the search item: the item at the
midpoint is less than 22.
Compare the item at the midpoint to the search item: the item at the
midpoint is 22.
134 24. SEARCHING ALGORITHMS
Compare the item at the midpoint to the search item: the item at the
midpoint is equal to 22.
□ less than □ 22
□ greater than □ 25
□ before □ 30
□ after □ 35
□ 11 □ 46
□ 16 □ 57
□ 17 □ 72
Tom sells knitwear via his website. He has a list with the number of products
that he’s sold in the last ten days. He wants to find out if there is a day that
he sold 35 products.
products_sold
11 16 17 22 25 30 35 46 57 72
Tom is using the binary search algorithm to search through the list of sales.
▶ Fill in the blanks with the values provided below to complete the steps
that a binary search will follow when searching for 35 in the products_sold
list.
Take the ordered list products_sold and the search item 35.
Initially, set the range of items where the search item might be found to be
the entire list.
24. SEARCHING ALGORITHMS 135
Compare the item at the midpoint to the search item: the item at the
midpoint is less than 35.
Compare the item at the midpoint to the search item: the item at the
midpoint is 35.
Compare the item at the midpoint to the search item: the item at the
midpoint is 35.
Compare the item at the midpoint to the search item: the item at the
midpoint is equal to 35.
□ less than □ 22
□ greater than □ 25
□ before □ 30
□ after □ 35
□ 11 □ 46
□ 16 □ 57
□ 17 □ 72
136 24. SEARCHING ALGORITHMS
Sally has a blog about children’s books. She has a list with the top seven
children’s books that were chosen by her readers. You can see the items of
the list below:
top7_books
Animal Black Elmer Heidi Robin- The Winnie-
Farm Beauty son Little The-
Crusoe Prince Pooh
Sally wants to find out if the book ‘Elmer’ is in the list. She is using the
binary search algorithm to search through the list of books.
▶ Fill in the blanks with a suitable word from the ones provided below to
complete the steps that a binary search will follow when searching for Elmer
in the top7_books list.
Take the ordered list top7_books and the search item Elmer.
Initially, set the range of items where the search item might be found to be
the entire list.
Compare the item at the midpoint to the search item: the item at the
midpoint is greater than Elmer.
Compare the item at the midpoint to the search item: the item at the
midpoint is Elmer.
24. SEARCHING ALGORITHMS 137
Compare the item at the midpoint to the search item: the item at the
midpoint is equal to Elmer.
□ less than
□ Elmer
□ greater than
□ Heidi
□ before
□ Robinson Crusoe
□ after
□ The Little Prince
□ Animal Farm
□ Winnie-The-Pooh
□ Black Beauty
Sally has a blog about children’s books. She has a list with the top seven
children’s books that were chosen by her readers.
top7_books
Animal Black Elmer Heidi Robin- The Winnie-
Farm Beauty son Little The-
Crusoe Prince Pooh
▶ Sally is using the binary search algorithm to find out if the book Peter
Pan is in the list. How many comparisons will the binary search algorithm
perform before it finishes?
138 24. SEARCHING ALGORITHMS
You have been provided with some cards that are in the following order:
▶ Why could you not use a binary search for this data?
⃝ The data is not a list of numbers. ⃝ The data is not sorted in an as-
cending (low to high) or des-
⃝ There is not enough data. cending (high to low) order.
You have been provided with some cards that are in the following order:
▶ You need to find out if the number 4 is in the list of cards. Which searching
algorithm would require the fewest number of comparisons to find the data?
⃝ Linear
⃝ Both would be the same
⃝ Binary
▶ You now need to find out if the number 9 is in the list of cards. Which
searching algorithm would require the fewest number of comparisons to find
the data?
⃝ Linear
⃝ Both would be the same
⃝ Binary
24. SEARCHING ALGORITHMS 139
Option B
1 FUNCTION linear_search (items , search_item )
2
3 // Initialise the variables
4 found_index = -1
5 current = 0
6 found = False
7
8 // Repeat while the end of the list has not been reached
9 // and the search item has not been found
10 WHILE current < LEN(items) AND found == False
11
12 // Compare the item at the current index to the
search item
13 IF items[ current ] == search_item THEN
14 // If the item has been found , store the current
index
15 found_index = current
140 24. SEARCHING ALGORITHMS
Answer:
A local hockey club keeps a directory of players’ email addresses, which they
use to send out information about training and fixtures. It currently has
1,000 entries.
items
index 0 1 2 3 4 5 6
value 2 4 5 8 12 15 18
The following algorithm has been coded and will be used to search for the
number 12 as highlighted in the array.
1 FUNCTION binary_search (items , search_item )
2
3 // Initialise the variables
4 found = False
5 found_index = -1
6 first = 0
7 last = LEN( items) - 1
8
9 // Repeat while there are still items between first and
last
10 // and the search item has not been found
11 WHILE first <= last AND found == False
12
13 // Find the midpoint position (in the middle of the
range)
14 midpoint = (first + last) DIV 2
15
16 // Compare the item at the midpoint to the search
item
17 IF items[ midpoint ] == search_item THEN
18 // If the item has been found , store the
midpoint position
19 found_index = midpoint
20 found = True // Raise the flag to stop the loop
21
22 // Check if the item at the midpoint is less than
the search item
23 ELSEIF items [ midpoint ] < search_item THEN
24 // Focus on the items after the midpoint
25 first = midpoint + 1
26
27 // Otherwise the item at the midpoint is greater
than the search item
142 24. SEARCHING ALGORITHMS
28 ELSE
29 // Focus on the items before the midpoint
30 last = midpoint - 1
31 ENDIF
32 ENDWHILE
33
34 // Return the position of the search_item or -1 if not
found
35 RETURN found_index
36
37 ENDFUNCTION
▶ Complete the trace table for the algorithm by adding the options provided
into the correct positions.
□ True
□ False
□ 3
□ 4
□ 5
□ 6
□ 8
□ 15
24. SEARCHING ALGORITHMS 143
Amaia coaches a school basketball team. She keeps the scores that the team
got in the latest tournament in a list called basketball_finals. You can see
the items of the list below:
basketball_finals
120 250 101 150 80 95 147 165
Amaia is using the linear search algorithm to find out if the team scored 150
points in any of the games.
▶ Put in order the steps that the linear search algorithm will follow when
searching for the item 150 in the list basketball_finals.
Amaia coaches a school basketball team. She keeps the scores that the team
got in the latest tournament in a list called basketball_finals. You can see
the items of the list below:
basketball_finals
120 250 101 150 80 95 147 165
▶ Amaia is using the linear search algorithm to find out if the team scored
200 points in any of the games. How many comparisons will the linear search
algorithm perform before it finishes?
24.10 Midpoint
AQA EDEXCEL EDUQAS OCR WJEC isaaccs.org/bq/dsa_search_g08
You have been given a set of cards that are in the following order:
▶ A binary search is going to be used to search for an item in the list. Which
card is at the first midpoint calculated by the algorithm?
25 Sorting algorithms
Sorting data is an essential data management task. You may need to display
information in a specific order, or you may need to sort your data to make
it quicker to search for something within the data set. There are many
standard algorithms that can be used to sort data, such as bubble sort and
merge sort.
At a more advanced level, you will learn that these sorting algorithms can
be implemented in code in a variety of ways. You will also learn that the
relative complexity of each algorithm can be compared, to allow the best
choice to be made for a specific problem.
Amaia coaches a school basketball team. She keeps the scores that the team
got in the latest tournament in a list called basketball_finals. You can see
the items of the list below:
basketball_finals
250 120 95 101 80
▶ Amaia wants to use the merge sort algorithm to sort the scores from lowest
to highest value. Fill in the gaps with the values to show the order of the
items after the first merge. Assume that the splitting stage has already
completed and each value is in a list of its own.
Final split
250 120 95 101 80
Merge 1
□ 80
□ 95
□ 101
□ 120
□ 250
145
146 25. SORTING ALGORITHMS
Geraint is using the insertion sort algorithm to put their list of top five
countries to visit into alphabetical order, from A to Z.
countries
Peru Laos Fiji Egypt Cuba
The insertion sort algorithm has been started on the list below. In the first
row, the first item is highlighted to show it is in the sorted sublist and the
unsorted sublist contains the remaining items.
In the second row, the first pass has completed and the sorted sublist now
contains two items, which are highlighted.
▶ Fill in the blanks to show the order of the countries at the end of each
pass when performing an insertion sort. Use a new row for each pass.
countries
Peru Laos Fiji Egypt Cuba
Laos Peru Fiji Egypt Cuba
□ Cuba
□ Egypt
□ Fiji
□ Laos
□ Peru
25. SORTING ALGORITHMS 147
□ The inner for loop could be changed so that the number of repetitions
is reduced by 1 after each pass
□ The inner for loop could be changed to a while loop that only swaps
items if they are out of order
□ The variable temp is not needed when swapping items in this way and
could be removed
□ The outer for loop could be changed so that the number of swaps made
is reduced by 1 after each pass
□ The outer for loop could be changed to a while loop that stops once
no swaps are made during a single pass
148 25. SORTING ALGORITHMS
▶ Put the lines of code provided into the correct order to create a bubble
sort algorithm. Please note that you should use correct indentation in your
answer.
□ NEXT pass_num
□ IF (items[index] >
items[index + 1])THEN
□ num_items = LEN(items)
□ NEXT index
□ END IF
□ items[index] = items[index +
1]
□ items[index + 1] = temp
□ FOR pass_num = 1 TO
num_items - 1
□ temp = items[index]
25. SORTING ALGORITHMS 149
You have been given some playing cards that have not been sorted:
▶ In an insertion sort, which would be the first card in the unsorted sublist
and therefore the first card to insert?
⃝
150 25. SORTING ALGORITHMS
Geraint is using the bubble sort algorithm to put their list of top five
countries to visit into alphabetical order, from A to Z.
▶ Using the countries list below, fill in the blanks to show the order of the
countries after each pass of the bubble sort algorithm, using a new row
for each pass. The algorithm will pass over the entire list four times.
countries
Laos Egypt Peru Fiji Cuba
□ Cuba
□ Egypt
□ Fiji
□ Laos
□ Peru
26 Legislation
Until the Computer Misuse Act 1990, there were no legal provisions in
UK law governing the use and misuse of computer systems. However, the use
of computers has become so widespread that further laws such as the Regu-
lation of Investigatory Powers Act 2000 have been enacted to take into
account technological growth and the widespread use of encryption. There
have also been recent changes to data protection law. The General Data
Protection Regulation (GDPR) in EU law creates a European standard
to protect individuals, and regulates how companies and organisations may
collect, hold, and use personal data. The Data Protection Act 2018 is
the UK’s implementation of the GDPR. Legislation also exists around the
use of copyrighted material through the Copyright, Designs and Patents
Act 1988.
▶ Select the type of licence that allows software code to be studied and
changed by anyone.
⃝ Multi-user
⃝ Open source
⃝ Proprietary
151
152 26. LEGISLATION
▶ For each sentence in the response, indicate whether the sentence demon-
strates knowledge (e.g. of a fact/concept), or the impact of a fact/concept:
that their work can be shared and adapted, but also ensure that their work
ing their work seen by a wider audience and allows others to legally develop
content .
□ Knowledge
□ Impact
26. LEGISLATION 153
▶ For each sentence in the response, indicate whether the sentence demon-
strates knowledge (e.g. of a fact/concept), or the impact of a fact/concept:
without paying for it and means that creators are more likely to be remuner-
ated for their work . The law was enacted in 1988 in the
This in turn might mean that creativity and innovation could be restricted,
□ Knowledge
□ Impact
154 26. LEGISLATION
▶ For each sentence in the response, indicate whether the sentence demon-
strates knowledge (e.g. of a fact/concept), or the impact of a fact/concept:
Act allow the police and prosecutors to take action against cybercrimin-
In this way, the Act provides a clear basis to convict those guilty of a vari-
to clearly warn potential offenders that they are not authorised to commit
□ Knowledge
□ Impact
26. LEGISLATION 155
▶ Complete the table by adding the correct piece of legislation to match the
relevant impact. Items can be selected more than once.
Impact Legislation
This gives the public the right to know what
public organisations spend their money on.
Actions that employers take using this legislation
can lead to the erosion of trust between employers
and employees.
Public debate can be better informed and more
productive because of this.
▶ Which one of these can lead to ethical issues when making use of machine
learning?
⃝ Syntax errors
⃝ Algorithmic bias
⃝ A pedestrian crossing
⃝ Speed cameras
⃝ Facial recognition
156
27. IMPACTS OF TECHNOLOGY 157
27.3 Impacts
AQA EDEXCEL EDUQAS OCR WJEC isaaccs.org/bq/iot_impacts_g03
▶ Complete the table by adding the correct type of impact for each example.
□ Social
□ Environmental
□ Cultural
□ Economic
□ Moral
□ Ethical
28 Programming concepts
Almost all programs consist of the same basic ‘building blocks’, assembled
in different ways to achieve a particular goal. Variables, data types, se-
quence, selection, and iteration are examples of these basic concepts,
which all new programmers need to learn. In order to compare and manipu-
late data, and to make decisions in a program, programmers use a variety of
different logical, relational, and arithmetic operators. It is also useful
to be able to generate randomness in a program, for example selecting a
random number or a random item from a list.
Martin wrote a program a few weeks ago, but he has forgotten to comment
his code, so he can’t remember how it works.
1 end = 10
2 FOR i = 1 TO end
3 IF (i MOD 2) == 0 THEN
4 PRINT (" red ")
5 ELSE
6 PRINT (" blue ")
7 ENDIF
8 NEXT i
⃝ blue
⃝ red
⃝ 0
⃝ 8
158
28. PROGRAMMING CONCEPTS 159
Sian is writing a program for a game with a grid. Here is the grid she is
using:
Sian wants to write some code to
x \y 1 2 3
generate the grid positions of every
1
shaded square on her grid so that she
2 @
can check them. For example, the co-
3
ordinates of the square containing the
4 #
@ sign would be x=2 y=2.
▶ Which of these pieces of code generates all of the shaded grid positions?
Circle the correct answer.
OPTION A
1 x = 1
2 y = 1
3 WHILE x <= 4 AND y <= 3
4 PRINT ("x=" + STR(x) + " y=" + STR(y))
5 x = x + 1
6 y = y + 1
7 ENDWHILE
OPTION B
1 FOR x = 1 TO 4
2 FOR y = 1 TO 3
3 PRINT ("x=" + STR(x) + " y=" + STR(y))
4 NEXT y
5 NEXT x
OPTION C
1 FOR x = 1 TO 7
2 PRINT ("x=" + STR(x) + " y=" + STR(x - 1))
3 NEXT x
OPTION D
1 FOR x = 1 TO 3
2 FOR y = 1 TO 4
3 PRINT ("x=" + STR(x) + " y=" + STR(y))
4 NEXT y
5 NEXT x
160 28. PROGRAMMING CONCEPTS
1 number = 5
2 triple = True
3
4 IF triple == True AND number >= 10 THEN
5 number = number * 3
6 ELSE
7 number = number + 5
8 ENDIF
▶ What is the value of the variable number once the code has finished ex-
ecuting?
28.4 Constants
AQA EDEXCEL EDUQAS OCR WJEC isaaccs.org/bq/gcse_prog_08
A banking system uses a constant to store the current rate of VAT so that
it can be used in calculations.
1 VAT_RATE = 0.20
1 PROCEDURE check_stock ()
2 fruit = INPUT (" What fruit would you like ?")
3 IF fruit == "Mango " THEN
4 level = "low"
5 ELSEIF fruit != " Banana " AND fruit != "Apple" THEN
6 level = "no"
7 ELSE
8 level = "good"
9 ENDIF
10 PRINT (" There is " + level + " stock ")
11 ENDPROCEDURE
▶ From the list of fruits that follows, select all the fruits which have a low
or good level of stock.
□ Peach
□ Banana
□ Apple
□ Mango
□ Orange
28.6 Modulo
isaaccs.org/bq/prog_concepts_arithmetic_operators_
AQA EDEXCEL EDUQAS OCR WJEC g02
1 PROCEDURE main ()
2 input_value = INPUT (" Enter a number : ")
3 num = INT( input_value )
4 count = 0
5 WHILE num < 500
6 num = num * 2
7 count = count + 1
8 ENDWHILE
9 PRINT (count - 1)
10 ENDPROCEDURE
Trace table
num count num < 500 OUTPUT
16 1 TRUE
32 2 TRUE
⃝ 64 3 TRUE
128 4 TRUE
256 5 TRUE
512 6 FALSE
5
Trace table
num count num < 500 OUTPUT
16 0 TRUE
32 1 TRUE
⃝ 64 2 TRUE
128 3 TRUE
256 4 TRUE
512 5 FALSE
4
28. PROGRAMMING CONCEPTS 163
Trace table
num count num < 500 OUTPUT
16 0 TRUE
32 1 TRUE
⃝
64 2 TRUE
128 3 TRUE
256 4 TRUE
FALSE 3
Trace table
num count num < 500 OUTPUT
16 0 TRUE
32 1 TRUE
⃝ 64 2 TRUE
128 3 TRUE
256 4 TRUE
512 5 FALSE
511
▶ Select the option that is most likely to be an example of the string data
type.
⃝ True ⃝ Five
⃝ 5.1 ⃝ 5
▶ Select the option that is most likely to be an example of the integer data
type.
⃝ 5.1 ⃝ False
⃝ Five ⃝ 5
164 28. PROGRAMMING CONCEPTS
▶ What will be the output of line 5 when the code is executed if the user
enters 1 for the first number and 7 for the second number?
1 PRINT (" Enter a number ")
2 num1 = INPUT ()
3 PRINT (" Enter another number ")
4 num2 = INPUT ()
5 PRINT (num1 + num2)
⃝ 8 ⃝ 17
▶ Which line of code in the program below contains a function that will
convert a string to an integer?
1 PRINT (" How old are you ?")
2 user_input = INPUT ()
3 age = INT( user_input )
4 months = age * 12
5 PRINT ("Wow , you have been alive for around " + STR( months ) +
" months !")
⃝ PRINT("Wow, you have been alive for around " + STR(months)+ " months!")
⃝ age = INT(user_input)
⃝ months = age * 12
⃝ user_input = INPUT()
▶ The code below is executed. If the user enters the string zero when
prompted for a decimal number, what will happen?
1 PRINT (" Enter a decimal number ")
2 user_input = INPUT ()
3 num1 = FLOAT( user_input )
4 PRINT (" Your decimal number is: " + STR(num1))
⃝ It will remind the user to enter a number and prompt them to enter it
again
⃝ 1,2,3
⃝ 4,7
⃝ 1,2,4,5,6,7,8,9
⃝ 1,4,7
Samir has created a program that keeps track of his team’s score for a local
table tennis league. Below is the program that he has written.
1 red_team = ["W","W","L","D"]
2 win = 4
3 draw = 2
4 loss = -1
5 total = 0
6
7 FOR EACH result IN red_team
8 IF result == "W" THEN
9 total = total + win
10 ELSEIF result == "D" THEN
11 total = total + draw
12 ELSE
13 total = total + loss
14 ENDIF
15 NEXT result
16 PRINT ( total )
28.17 Countdown
AQA EDEXCEL EDUQAS OCR WJEC isaaccs.org/bq/prog_concepts_iteration_g03
⃝ 3,2,1,Time is up
⃝ 3,2,1,0,Time is up
⃝ Time is up
▶ What will happen when this program is executed? Choose one from the
list of four options.
28.20 IF/ELSE
AQA EDEXCEL EDUQAS OCR WJEC isaaccs.org/bq/prog_concepts_selection_g02
⃝ 25
⃝ 18
⃝ 18, 25
⃝ 16
28. PROGRAMMING CONCEPTS 169
▶ Put the blocks of code in the correct order to form a working segment of
code.
□ hours_slept = INT(INPUT())
□ ELSE
□ ENDIF
28.22 Is it morning?
AQA EDEXCEL EDUQAS OCR WJEC isaaccs.org/bq/prog_concepts_selection_g03
⃝ Good morning
⃝ 1
⃝ 4
⃝ 2
⃝ 2,3
28. PROGRAMMING CONCEPTS 171
⃝ player_name
⃝ "BlueSky93"
⃝ There is an error in the program
⃝ BlueSky93
⃝ BlueSky93
⃝ BlueSky93, DinoFish40
⃝ DinoFish40
⃝ player_name
29 String handling
A string is a sequence of characters (letters, numbers, spaces, or other
symbols). String handling techniques are used to check and manipulate
string data, for example to determine whether a password is sufficiently
long, or to remove or replace characters in a piece of text.
This topic uses a single version of pseudocode and versions of real program
code in Python and C#.
Nitin owns a car showroom, and he has records of all of the cars he has in
stock. The records include the cars’ number plates. The number plates are
all in the following format, where L is a letter and N is a number:
LLNNLLL
Nitin has written a program to try to extract only the two numbers (NN)
from the number plate of every car, which represent the year in which it was
registered.
The documentation for the programming language said, “to obtain a sub-
string, you must specify the starting position (numbering starts at 0), the
ending position (inclusive), and the string itself”.
He isn’t sure whether the program he has written is correct. Here is his code:
numberplate = " ZX19CSV "
year = numberplate [2:5]
PRINT (year)
172
29. STRING HANDLING 173
▶ Select the option that best describes why the check_password function
returns False when it is called with the argument “My Great Password”?
▶ Select the line of code the programmer should use to remove the unwanted
character.
▶ Using four of the lines of code supplied, create a program that uses
concatenation to produce this output:
Venus is the hottest planet.
□ print(string)
▶ Which one of these shows a variable that has been assigned an empty
string?
⃝ word = 0
⃝ word = "0"
⃝ word = " "
⃝ word = ""
176 29. STRING HANDLING
29.6 Indexing
AQA EDEXCEL EDUQAS OCR WJEC isaaccs.org/bq/prog_string_g05
⃝ L
⃝ o
⃝ v
⃝ 4
⃝ 5
⃝ 6
⃝ Pi
⃝ name[:-1]
⃝ ie
⃝ P
29. STRING HANDLING 177
29.9 Validation
AQA EDEXCEL EDUQAS OCR WJEC isaaccs.org/bq/prog_string_g08
▶ Which one of these is the reason for using LOWER() when validating user
input to this prompt?
1 answer = "Would you like to continue ? Enter Y or N: "
▶ From the sentences below select the one that best describes a global
variable.
178
30. SUBROUTINES 179
George tests his program by typing in the numbers 5 and 2, and this is what
he sees:
▶ Why does the final line state that the result is null?
The cube of a given number is that number multiplied by itself three times.
For example, the cube of 3 is 27.
Lucy has created a program (shown in pseudocode below) that uses a sub-
routine named cubed to carry out the calculation. When she runs the pro-
gram, Lucy is not getting the output that she was expecting.
1 FUNCTION cube(num)
2 cubed_value = num * num * num
3 RETURN cubed_value
4 ENDFUNCTION
5
6 PROCEDURE main ()
7 input_value = INPUT (" Enter a value to be cubed : ")
8 user_num = INT( input_value )
9 cube( user_num )
10 ENDPROCEDURE
▶ How should she amend it so that the cubed value is outputted correctly?
⃝ PRINT(cube(user_num))
⃝ PRINT(cubed_value)
⃝ PRINT(num)
⃝ PRINT(user_num)
30. SUBROUTINES 181
30.5 Parameters
AQA EDEXCEL EDUQAS OCR WJEC isaaccs.org/bq/prog_sub_g01
□ no
□ identifier
□ called
□ declared
30.6 Arguments
AQA EDEXCEL EDUQAS OCR WJEC isaaccs.org/bq/prog_sub_g02
□ subroutine
□ parameters
□ items
□ program
182 30. SUBROUTINES
30.7 Procedures
AQA EDEXCEL EDUQAS OCR WJEC isaaccs.org/bq/prog_sub_g03
A student wants a subroutine that will add any two given numbers together
and to display the answer.
▶ Use the lines of code below to construct a display_sum procedure for them.
□ ENDPROCEDURE
□ PRINT (answer)
□ PROCEDURE
display_sum(num1,
num2)
▶ Rearrange the lines of code below to construct a function, then call the
function and pass data to it.
□ FUNCTION
calculate(num1, num2)
□ ENDFUNCTION
□ PRINT (answer)
□ answer = calculate(5,
10)
□ RETURN answer
30. SUBROUTINES 183
30.9 Functions
AQA EDEXCEL EDUQAS OCR WJEC isaaccs.org/bq/prog_sub_g09
□ returning
□ value
□ procedure
□ function
▶ From the sentences below select the one that best describes a local vari-
able.
⃝ When creating very large programs, you can give different program-
mers different subroutines to write, and these can then be combined.
⃝ Subroutines are always defined by the user, and these cannot be com-
bined.
⃝ Procedures allow values to be returned to the procedure call.
You have been tasked with creating a program that multiplies any two num-
bers together.
□ ENDFUNCTION □ PROCEDURE
□ ENDPROCEDURE □ PRINT
□ RETURN □ FUNCTION
30. SUBROUTINES 185
Maja has written a program that is supposed to display how much one person
should pay if a restaurant bill is split equally between the people present.
The program isn’t working correctly; when Maja runs it, the amount does
not appear on the screen.
Natalia is a software developer for a clothes retailer. She has a csv file
named ‘stock.csv‘ that includes information on all of the clothing sold by
the retailer.
Task Mode
Add new new items of clothes to ‘stock.csv’
Search the file for a specific item of clothes
Create a new file named ‘search-results.csv‘.
Overwite contents of ‘search-results.csv‘ with the
results of each new search
▶ Look through the list of jobs above Natalia has to perform and decide
which file handling mode below would be most suitable for each task.
□ Write
□ Append
□ Read
186
31. FILE HANDLING 187
The user wants a list of only the titles of all the apps they have purchased.
▶ Use the items below to complete the subroutine that will print a list of
titles for the customer. The field that contains the title is AppTitle.
1 SUBROUTINE read_csv ()
2 file_object =
____________________ (' user_download_history .csv ')
3 WHILE NOT file_object . END_OF_FILE ()
4 record = file_object . READ_LINE ()
5 app_data = ____________________ (record ,
'____________________ ')
6 app_title = movie_data [ ____________________ ]
7
8 PRINT ('App title : ' + ____________________ )
9 ENDWHILE
10 file_object .CLOSE ()
11 ENDSUBROUTINE
□ OPEN_READ □ SPLIT
□ 1 □ app_title
□ , □ AppTitle
□ 0 □ SEPARATE
188 31. FILE HANDLING
Kasim has a file with the name test_data.csv. He needs to write code to be
able to open the file and to output the first line so that knows the headings
of each column.
▶ Reorder the code below so that Kasim has a working program that reads
and outputs only the first line of the file.
Note: Not all lines of code provided are needed to complete the program
□ file_object = OPEN_WRITE("bridge.txt")
□ PRINT(headings)
□ headings = file_object.READ_LINE()
□ file_object.CLOSE()
□ file_object = OPEN_READ("bridge.txt")
31. FILE HANDLING 189
▶ Using the code options provided, add the lines of code into the correct
order to complete the new procedure. You do not have to use all the lines
of code provided.
2 __________________________________________
3 __________________________________________
4 __________________________________________
5 ENDPROCEDURE
□ file_object = OPEN_APPEND(”list.txt”)
□ file_object.WRITE_LINE(new_name)
□ file_object.CLOSE()
□ file_object = OPEN_READ(”list.txt”)
□ file_object.READ_LINE()
□ file_object = OPEN_WRITE(”list.txt”)
190 31. FILE HANDLING
1 PROCEDURE main ()
2 title = INPUT ('Enter the movie title : ')
3 year = INPUT ('Enter the movie year: ')
4 duration = INPUT(' Enter the length of the movie (01:00) :
')
5 director = INPUT(' Enter the name of the movie 's
director : ')
6 rating = INPUT(' Enter the average movie rating (1 to 5):
')
7 price = INPUT ('Enter the price in pounds (£00 .00) :')
8 append_movie_optimised (title , year , duration , director ,
rating , price)
9 ENDPROCEDURE
10
11 PROCEDURE _________________ (title , year , duration , director ,
rating , price)
12 _________________ = title + ',' + year + ',' + duration
+ ',' + director + ',' + rating + ',' + price
13 file_object = _________________ (' movies .csv ')
14 _________________ ( new_movie )
15 file_object . _________________ ()
16 ENDPROCEDURE
□ append_movie_optimised □ ENDPROCEDURE
□ OPEN_WRITE □ CLOSE
□ OPEN_APPEND □ file_object.WRITE_LINE
□ new_movie □ OPEN_READ
31. FILE HANDLING 191
▶ Which one of these options should be used to open a file to output its
contents?
⃝ OPEN.APPEND('food.txt')
⃝ OPEN.WRITE('food.txt')
⃝ OPEN('food.txt')
⃝ OPEN.READ('food.txt')
31.7 Is it true?
AQA EDEXCEL EDUQAS OCR WJEC isaaccs.org/bq/prog_files_g08
□ The append mode adds new data at the end of the file.
□ The use of write mode can overwrite the existing data of a file.
□ The read mode allows new data to be added to the end of the file.
⃝ TRUE
⃝ .csv
⃝ The last line of data
192 31. FILE HANDLING
□ CLOSE □ PROCEDURE
□ OPEN_APPEND □ add_items
□ READ_LINE □ items_list.txt
31. FILE HANDLING 193
tel_number )
2 ______________________________________________
3 ______________________________________________
4 ______________________________________________
5 ENDPROCEDURE
□ file = OPEN_APPEND("customers.txt")
□ file_object.CLOSE()
32 Integrated development environments
(IDEs)
An integrated development environment (IDE) is software that in-
cludes various features to help a programmer develop their program code.
Most IDEs will include facilities such as automatic formatting and debug-
ging tools such as break points. It is common for an IDE to allow code to
be executed from inside the environment, with the help of an interpreter
or compiler.
32.2 Debugging
EDUQAS WJEC isaaccs.org/bq/prog_softeng_ide_g03
□ Break point
□ Automatic formatting
□ Syntax checking
□ Threading
194
32. INTEGRATED DEVELOPMENT ENVIRONMENTS (IDES) 195
The table below provides definitions for some of the features of an integrated
development environment (IDE).
▶ Put the words into the spaces provided to match the feature to the defin-
ition.
Definition Feature
The window in your IDE that allows you to write
your code
Allows you to add a pause to your program to
stop the flow of execution, and step through the
following code line by line to trace the values of
the variables
Colour that is applied to key elements of code,
such as variables, functions, and data type
Uses a translator to execute your program code
Connects pre-compiled libraries to your program
so that they can be used together
A feature that spots problems in your code as you
write it, which would cause an error when the
program is executed
□ Linker
□ Text editor
□ Keyword highlighting
□ Break point
□ Syntax checker
□ Runtime environment
196 32. INTEGRATED DEVELOPMENT ENVIRONMENTS (IDES)
helps to your
by reducing typos and helping you to avoid common mistakes, such as for-
cause it makes sure your code matches the requirements of the programming
Debugging tools make it easier to track down and fix errors in programs.
A break point adds a pause to the program to stop the flow of execution.
debug problems with memory allocation in the program. It can help you
□ flow
□ step
□ Autocomplete
□ productivity
□ whole
□ speed up
□ data
32. INTEGRATED DEVELOPMENT ENVIRONMENTS (IDES) 197
32.5 Loaders
EDUQAS WJEC isaaccs.org/bq/prog_ide_g01
198
33.2 Structured benefits
AQA isaaccs.org/bq/prog_pas_g02
199
200 34. OBJECT-ORIENTED PROGRAMMING
34 Object-oriented programming
Object-oriented programming (OOP) is an approach to systems de-
velopment that focuses on objects and the way that they interact. Objects
surround us in the real world. Look around you. For example, I am a per-
son, and I have a desk, a computer, and a cup of water; these are all objects.
How do they interact? I sit at my desk, switch on the computer, and drink
some water.
The OOP method of programming (or paradigm) is different to the proced-
ural paradigm, which many programmers start out with on their learning
journey. In this topic you will learn about objects and how they can be
defined and worked with in a computer system.
26 ENDPROCEDURE
27
28 PUBLIC PROCEDURE set_station ( new_station )
29 station = new_station
30 ENDPROCEDURE
31
32 PUBLIC PROCEDURE switch ()
33 IF on == True THEN
34 on = False
35 ELSE
36 on = True
37 ENDIF
38 ENDPROCEDURE
39 ENDCLASS
15
16 PUBLIC FUNCTION get_station ()
17 RETURN station
18 ENDFUNCTION
19
20 PUBLIC FUNCTION is_on ()
21 RETURN on
22 ENDFUNCTION
23
24 PUBLIC PROCEDURE set_volume ( new_volume )
25 volume = new_volume
26 ENDPROCEDURE
27
28 PUBLIC PROCEDURE set_station ( new_station )
29 station = new_station
30 ENDPROCEDURE
31
32 PUBLIC PROCEDURE switch ()
33 IF on == True THEN
34 on = False
35 ELSE
36 on = True
37 ENDIF
38 ENDPROCEDURE
39
40 ENDCLASS
▶ An object has been created based on the class definition shown above
and assigned to a reference variable called my_radio. Which of the following
options (expressed in pseudocode) will set the volume of this radio object to
6?
⃝ my_radio.volume = 6
⃝ my_radio.set_volume()= 6
⃝ my_radio.set_volume(6)
34. OBJECT-ORIENTED PROGRAMMING 203
▶ In testing, it was found that the volume of the radio could be set to an
unsafe level. The set_volume method must be updated so that it does not
allow the volume to exceed a setting of 30. Order the given statements to
create an updated version of the method. You must use all of the statements
with correct indentation in your solution.
□ ENDPROCEDURE
□ ELSE
□ volume = 30
□ ENDIF
□ volume = new_volume
35 Design
Design is an essential part of application systems development.
Developers need to carefully plan and consider many different solutions be-
fore they even start typing code. Every part of a solution needs to be con-
sidered, including the interface and even the data that a program will be
working with. Large applications need to be broken down into modules,
and specific algorithms need to be designed for each important process.
Algorithms can be expressed in a variety of ways. A flowchart is a useful
visual technique to show the flow of logic through a program. Pseudocode
is useful when the design will be passed to a programmer who can convert
the pseudocode into real program code.
▶ Which of the following statements would you put into the flowchart symbol
above?
⃝ PRINT("Hello")
⃝ START
⃝ cost = cost + 25
205
206 35. DESIGN
There are often many different algorithms that can accomplish the same
task.
You have been asked to create a program to solve the following problem:
Rik would like the program to calculate how long the heater needs
to be on for to bring the container up to the right temperature.
▶ The first step to solving this problem is to break it down into the inputs,
processes, and outputs. Use the words below to complete the following
decomposition of Rik’s problem.
□ current □ difference
□ ideal □ multiply
□ time □ volume
208 35. DESIGN
Answer:
▶ Which of the following statements could you put into the flowchart symbol
shown above?
⃝ PRINT("Hello")
⃝ cost = cost + 25
⃝ cost > 10?
⃝ START
210 35. DESIGN
▶ Fill in the trace table by putting the correct values from the options given.
index OUTPUT
0
c
□ 1
□ o
□ 2
□ m
□ 3
□ p
□ 4
□ u
□ 5
□ t
□ 6
□ e
□ 7
□ r
□ 8
35. DESIGN 211
▶ Trace the algorithm and fill in the trace table by using the correct values
from the options given.
212 35. DESIGN
0
12
3
1.5
4
□ 3
□ 4
□ Error
□ 2
□ 6
□ 1
□ 24
36 Testing
Before a piece of software can be used, it needs to be tested. Some testing
is done by the programmer as the code is written. Other testing is more
structured and involves a test plan being written and the software being
tested with a variety of types of data to check that the outputs are as ex-
pected. When a problem with the software is identified, the cause will need
to be identified. This is called debugging.
▶ The table below contains descriptions of the types of errors that can occur
during programming. Add the types of errors into the correct positions in
the table.
□ Syntax
□ Logic
□ Runtime
213
214 36. TESTING
The program below asks a user to enter a week number and validates their
input by checking that the week number entered is between 1 and 52.
▶ Which of the options below would be boundary test data for this pro-
gram?
The program below asks a user to enter a week number and validates their
input by checking that the week number entered is between 1 and 52.
1 user_input = INPUT (" Enter a week of the year: ")
2 week = INT( user_input )
3
4 IF week > 0 AND week <= 52 THEN
5 PRINT (" You have chosen week " + STR(week))
6 ELSE
7 PRINT (" The week must be between 1 and 52")
8 ENDIF
▶ Write a week number that could be used as a piece of normal or typical
test data for this program.
36.4 Fail to plan, plan to fail
AQA EDEXCEL EDUQAS OCR WJEC isaaccs.org/bq/soft_testing_g03
▶ Below is a testing table that has been developed to test a program that
takes in students’ test scores and stores them in a database. The system
should allow the user to enter the student’s name and scores from three
separate tests ranging from 0 to 30 marks. Select the correct types of test
data from Boundary, Normal or Erroneous and place them in the correct
positions in the table. Note that the types of test data can be used more
than once.
215
216 37. COMPUTATIONAL THINKING
37 Computational thinking
Computational thinking is the term used to describe some of the skills
required in computing, programming, and digital making. Before you can
use a computer to solve problems, you need to pick those problems apart
and decide how to approach them.
Computational thinking techniques and methods are essential when formu-
lating a problem and expressing a solution so that a computer can effectively
it carry out.
Computational thinking covers a broad range of knowledge and skills, in-
cluding but not limited to:
At a more advanced level, you will learn about a wide range of abstrac-
tion techniques and computational methods that can be used to help solve
complex problems.
37. COMPUTATIONAL THINKING 217
▶ Fill in the gaps in the sentence below to explain how Lottie could use
decomposition to tackle the problem.
more manageable tasks that Lottie could approach one at a time. These
□ combined
□ smaller
□ broken down
□ sub-elements
□ larger
□ subtasks
218 37. COMPUTATIONAL THINKING
Sami is creating a game. The game will allow the player to move a small
alien through a maze to return it safely to its spaceship.
⃝ Pattern recognition
⃝ Algorithmic thinking
⃝ Abstraction
⃝ Decomposition
At this stage, Sami is focusing on the main features of game play, such as
character movement and scoring.
□ How the score would change if the alien reaches the end of the maze
Definition Keyword
The process of breaking down large problems
into smaller, simpler, more manageable parts
The process of spotting similarities in smaller
problems to develop solutions to more complex
problems
The process of removing unnecessary detail from
a problem to aid development of the solution
The process of identifying the logical steps
required to solve a problem
□ Decomposition
□ Abstraction
□ Pattern recognition
□ Algorithmic thinking