0% found this document useful (0 votes)
22 views

GCSE Timed Tests Computing

The document is a CGP revision guide for the GCSE OCR Computer Science Grade 9-1 course, featuring 10-Minute Tests designed for quick practice on various topics including programming and data representation. It includes answers for all questions and aims to aid students in their exam preparation for 2022 and beyond. The guide emphasizes quality content and accessibility at affordable prices.

Uploaded by

komenet870
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

GCSE Timed Tests Computing

The document is a CGP revision guide for the GCSE OCR Computer Science Grade 9-1 course, featuring 10-Minute Tests designed for quick practice on various topics including programming and data representation. It includes answers for all questions and aims to aid students in their exam preparation for 2022 and beyond. The guide emphasizes quality content and accessibility at affordable prices.

Uploaded by

komenet870
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 72

CGP

GCSE OCR
Computer Science
For the Grade 9-1 course

10-Minute Tests
Includes Answers
For exams in 2022 and beyond
The CGP dream team for OCR
GCSE Computer Science!
CGP CGP
Q7P

GCSE OCR GCSE OCR


GCSE OCR Computer Science
Computer Science For the Grade 9-1 Course For the Grade 9-1 Course
For the Grade 9-1 Course
CGP

CGP
GCSE OCR tice Exam Papers
Th< Computer Science
GCSE OCR For the Grade 9-1 Examt

Computer Science
For the Grade 9-1 course
GCSE OCR
Computer
Complete Science
Revision & Practice
10 -Minute Tests •-0 ><X> to rne Hons'

Revision
Question Cards

Out now at cgpbooks.co.uk

amazon.couk WHSmith Waterstones


CGP has it all (net)worked out...
GCSE Computer Science exams are pretty tough — but don't worry,
this brilliant CGP book is here to RAM home your revision!

It's packed with 10-Minute Tests covering every topic from the
new OCR course — including tricky programming skills.
Perfect for quick bursts of digestible practice.

And with answers for all questions at the back of the book,
it'd be a logic error to choose anyone other than CGP!

CGP — still the best ©


Our sole aim here at CGP is to produce the highest quality books
— carefully written, immaculately presented and
dangerously close to being funny.

Then we work our socks off to get them out to you


— at the cheapest possible prices.
Published by CGP
Editors:
Liam Dyer, Sammy El-Bahrawy, Michael Weynberg
Contributor:
Oliver Kerr

ISBN: 978 1 78908 559 4


With thanks to Chris Charles and Simon Little for the proofreading.
With thanks to Lottie Edwards for the copyright research.

Printed by Elanders Ltd, Newcastle upon Tyne

Based on the classic CGP style created by Richard Parsons.

Text, design, layout and original illustrations © Coordination Group Publications Ltd. (CGP) 2020
All rights reserved.

Photocopying this book is not permitted, even if you have a CLA licence.
Extra copies are available from CGP with next day delivery • 0800 1712712 • www.cgpbooks.co.uk
Contents


Section 1 Components
of a Computer System
Section 5
Test 18
— Algorithms
36
fest 1 2 Test 19 38
Test 2
Test 3
.4
6
Section 6 — Programming
Test 20 40
Section 2
Test 4
— Data Representation
8
Test 21 42
Test 22 44
Test 5 10 Test 23 46
Test 6
Section 3 — Networks
12

Section 7 Design,
Testing and IDEs
Test 7 14 Test 24 48
Test 8 16 Test 25 50
Test 9 18 Mixed Tests for Paper 2
Test 1O 20 Test 26 52
Section 4
Test 11
— Issues 22
Test 27
Test 28
54
56
Test 12 24 Test 29 58
Mixed Tests for Paper 1 Test 30 60
Test 13 26
Test 14 28 Answers „ 62
Test 15 30 Progress Chart 67
Test 16 32
Test 17 34
2 Section 1: Components of a Computer System
Test 1
There are 12 questions in this test. Give yourself 10 minutes to answer them all.

1. Which of these contains instructions used by 2. Which part of the CPU performs operations
the CPU when a computer is booting up? such as AND, OR and NOT?
A Hard disk drive A Arithmetic Logic Unit (ALU)
B RAM B Control Unit (CU)
C ROM C Memory Data Register (MDR)
[l] [1]

3. A device driver is a piece 4. Which of the following types of storage


of software which... media are commonly used by businesses
to archive large amounts of data?
A ... provides a user interface.
A Hard disk drive
B ... allows an OS to interact with
internal hardware or peripherals. B Optical disc
C ... manages user files and applications. C Magnetic tape
[1] [1]

5. Processor registers temporarily hold 6. Which of these types of storage generally


small amounts of data needed by... has the highest cost per gigabyte?
A ... the CPU. A Solid state drives
B ... RAM. B Hard disk drives
C ... the hard disk drive. C Magnetic tape
[1] [1]

7. True or False? “In the Von Neumann 8. An operating system helps


architecture, the same memory unit with file management by...
is used for data and instructions.” A ... compressing every file.
A True B ... arranging the files into
B False a hierarchical structure.
[1] l>]

Section 1: Components of a Computer System © CGP — not to be photocopied


3
9. Give an example of a device which is likely to contain an embedded system.

[1]

10. How does virtual memory impact a computer’s performance?

[1]

11. Outline how encryption software can help to keep data secure.

P]

12. Explain what happens during the ‘fetch’ stage of the fetch-execute cycle.

P]
15

© CGP — not to be photocopied Section 1: Components of a Computer System


4

Test 2
There are 11 questions in this test. Give yourself 10 minutes to answer them all.

1. ROM is... 2. Hard disk drives are a type of...


A ... volatile. A ... primary storage.
B ... non-volatile. B ... secondary storage.
[1] C ... tertiary storage.
[1]

3. True or False? “SSDs experience the same 4. Clock speed is...


fragmentation problems as HDDs.” A ... the number of instructions that
A True a CPU can process at the same time.
B False B ... the number of cycles per second
[1] that a CPU can carry out.
W

5. Cache memory has... 6. RAM is used for...


A ... a large capacity that is slow A ... storing instructions that tell
for the CPU to access. the CPU how to boot up.
B ... a large capacity that is quick B ... archiving information.
for the CPU to access. C ... storing data, files and
C ... a small capacity that is quick programs that are in use.
for the CPU to access.
[I]

7. Virtual memory is used when... 8. What type of utility software scrambles data
to stop third-parties from accessing it?
A ... RAM is full of data.
A Defragmentation
B ... the hard drive is full of data.
B Compression
C ... ROM is full of data.
[1] C Encryption
[1]

Section 1: Components of a Computer System © CGP — not to be photocopied


5
9. What is the purpose of the CPU?

10. What are two main functions of an operating system?

1.

[2]

11. Greg is building his own PC and is deciding whether to have


a Hard Disk Drive (HDD) or a Solid State Drive (SSD).
Give two advantages and two disadvantages of choosing the SSD instead of the HDD.

Advantages:

Disadvantages:

15
W

© CGP — not to be photocopied Section 1: Components of a Computer System


6

Test 3

There are 12 questions in this test. Give yourself 10 minutes to answer them all.

1. Which type of user interface requires 2. Embedded systems are designed to...
the most resources to run? A ... carry out a single task efficiently.
A Command line interface B ... carry out a variety of tasks.
B Graphical user interface [l]
[1]

3. An OS may make use of a 4. Which type of storage generally


buffer when transferring data. has the fastest read/write speed?
Buffers are used... A Memory card
A ... for temporary data storage. B Optical disc
B ... for long-term data storage. C Solid state drive
[1]
[l]

5. True or False? “The OS gives some 6. Increasing the number of cores in a CPU...
processes a higher priority for A ... increases the number of instructions
execution by the CPU than others.” processed by each core per second.
A True B ... increases the number of instructions
B False that can be carried out at the same time.
[I] [1]

7. Which of the following is an example 8. Which of the following components


of a magnetic storage device? controls the flow of data in the CPU?
A Memory card A ALU
B DVD B OS
C HDD C CU
[1] [1]

Section 1: Components of a Computer System © CGP — not to be photocopied


7
9. Sian uses compression software on a file. Give one benefit of compressing the file.

[I]

10. What is the function of the accumulator?

11. Give two security measures an OS may have to prevent unauthorised access.

2
[2]

12. A teacher wants to provide each of their students with some files and
open-source software, which will take up 6.5 GB of storage space.
State an appropriate storage device to use. Give two reasons for your answer.

Storage device:

2.

[3]
15

© CGP — not to be photocopied Section 1: Components of a Computer System


8 Section 2: Data Representation
Test 4

There are 11 questions in this test. Give yourself 10 minutes to answer them all.

1. Which of these units of data is the largest? 2. Which of the following denary values
represents the hexadecimal character “E”?
A Gigabyte
A 15
B Megabyte
B 13
C Terabyte
[1] C 14
[1]

3. Unicode® is a character set 4. The size of a sound file (in bits) is


which has characters for... calculated using the formula...
A ... all major languages. A ... sample rate x bit depth + duration
B ... the English language only. B ... sample rate x bit depth x duration
[1] C ... sample rate + bit depth + duration
[1]

5. Which of the following binary numbers 6. The most significant bit of an


represents the denary value 33? 8-bit binary number is...
A 00100001 A ... the left-most bit.
B 01000001 B ... the right-most bit.
[1]
C 00010001
[1]

7. How many characters are 8. Pixels are...


in the ASCII character set? A ... small dots that make
A 64 up a bitmap image.
B 128 B ... pieces of information that contain an
image’s file format, colour depth, etc.
C 256
[1]
[1]

Section 2: Data Representation © CGP


— not to be photocopied.
9
9. Add the binary numbers 01010101 and 01101101.

[2]

10. Explain what is meant by ‘overflow’.

[2]

11. A photographer wants to compress some high-quality images so they can be


stored on an external hard drive, while maintaining the quality of the images.
Which type of compression should the photographer use?

[I]
Explain why this type of compression is the most appropriate for the photographer.

[2]
15

© CGP — not to be photocopied Section 2: Data Representation


10

Test 5

There are 11 questions in this test. Give yourself 10 minutes to answer them all.

1. A one place left shift on a binary number... 2. All data must be converted into...
A ... doubles the number. A ... a binary format to be
processed by a computer.
B ... halves the number.
[I] B ... a hexadecimal format to be
processed by a computer.
[1]

3. How many bits are in a kilobyte? 4. True or False? “An image’s creation date,
time and location are all types of metadata.”
A 8000
A True
B 1000
B False
C 4
[1]
[1]

5. Which of these hexadecimal 6. The process of converting an analogue


numbers is the largest? signal to a digital signal is known as...
A 23 A ... compression.
B IF B ... re-coding.
C 2A C ... sampling.
[1] [1]

7. Hexadecimal numbers are often 8. Increasing the number of bits


used by programmers instead of used for each pixel in an image will...
binary numbers because...
A ... increase the range of colours
A ... there are fewer hexadecimal that the image can display.
numbers than binary numbers. B ... decrease the resolution of the image.
B ... they are shorter, which makes C ... have no effect on the file size.
them easier to remember.
[1]
[1]

Section 2: Data Representation © CGP — not to be photocopied


11
9. Ben opens a text file. It contains 30 characters, as shown below.
Each character is represented using the ASCII character set.

Calzones? Yes, they are yummy! I


The binary representation for the character ‘y’ is 01111001.
What is the binary representation for the character ‘z’?

[1]

Calculate the size of the text file in bits.

[2]

10. Convert the hexadecimal number 5E into binary.

[2]

11. A singer is recording the vocal tracks for their new album.
A sound engineer increases the sample rate and bit depth of the recordings.
Outline one benefit and one drawback of these changes.

Benefit:

Drawback:

P]
15

© CGP — not to be photocopied Section 2: Data Representation


12

Test 6

There are 1 1 questions in this test. Give yourself 10 minutes to answer them all.

1. How many bits are in a nibble? 2. A hexadecimal digit can represent...


A 2 A ... 2 different values.
B 4 B ... 10 different values.
C 8 C ... 1 6 different values.
[i] [1]

3. What is 00 1 00 11 1 as a denary number? 4. Decreasing the sample rate...


A 43 A ... reduces the size of a sound file.
B 39 B ... reduces the bit depth.
C 78 C ... reduces both the size of a
in sound file and the bit depth.
[1]

5. Which of the following character sets 6. An image file has a size of 4 MB.
represents more characters? How much storage space would
1000 copies of this file take up?
A ASCII
A 4 gigabytes
B Unicode®
Ui B 4 petabytes
C 40 000 bytes
[1]

7. Which of the following denary values 8. The 8-bit binary number 10011001 is
is equal to the hex value FF? added to itself. The calculation would...
A 15 A ... cause an overflow error.
B 128 B ... not cause an overflow error.
C 255 [I]

[i]

Section 2: Data Representation © CGP


— not to be photocopied
13
9. The function s h1 f t R takes an 8-bit binary number, performs a 4 place right shift
and returns an 8-bit answer. State what the following would return:

shiftR(OOHOOOO)

shiftR(llOllOOl)
[2]
The function shi ftR is used to divide numbers by 16.
Outline why shi f tR( 11011001 ) returns an answer with a loss of accuracy.

[1]

10. Claire has received a compressed version of a file in an email.


Why has compression been used on this file?

[2]

11. A program receives the 7-digit binary number 1001000 as an input.


1 is appended to the end of the number and its denary value is output.
What is the output of the program?

[2]

© CGP — not to be photocopied Section 2: Data Representation


14 Section 3: Networks

Test 7
There are 11 questions in this test. Give yourself 10 minutes to answer them all.

1. The World Wide Web is based on... 2. True or False? “A WAN connects LANs
across large geographical distances.”
A ... a client-server relationship.
A True
B ... a peer-to-peer relationship.
[1] B False

3. A packet is... 4. Which of these pieces of hardware


transmits data between networks?
A ... a type of file.
A NIC
B ... a chunk of data being
transmitted over a network. B Switch
C ... a network protocol. C Router
[1] [1]

5. What is an advantage of creating a piece of 6. Which type of wireless technology


hardware that follows certain standards? typically has a larger connection range?
A It will be compatible with A Wi-Fi®
other pieces of hardware. B Bluetooth®
B It is much cheaper to manufacture. [1]
[1]

7. Which of these protocols would 8. Which of these is an example


be used to upload a large number of a phishing attack?
of files to a remote server? A Downloading software containing
A HTTP a virus from the Internet.
B IMAP B Attempting to gain sensitive
information by impersonating a
C FTP
trustworthy person or business.
[1]
C Attempting to overload a server
to cause it to crash.
[1]

Section 3: Networks © CGP


— not to be photocopied
15

9. What is the name of the network topology


represented in the diagram on the right?

[I]

10. Cameron uses a weak password on his computer and has not updated his
anti-malware software. How could each of his actions put his computer at risk?

[2]

11. Give two advantages and two disadvantages of storing data in the cloud.

Advantages:

Disadvantages:

2.

15

© CGP — not to be photocopied Section 3: Networks


16

Test 8

There are 11 questions in this test. Give yourself 10 minutes to answer them all.

1. Which type of cable is best for 2. Which of the following examines data
transmitting data over very large entering and leaving a network in order
distances without losing signal quality? to block any potential threats?
A Coaxial A Router
B Ethernet B Firewall
C Fibre optic C Switch
[1] [1]

3. Bandwidth is... 4. True or False? “IP addresses


are assigned to network-enabled
A ... the amount of data that can be
devices by the manufacturer.”
transferred in a given time.
A True
B ... the maximum range
of a wireless LAN. B False
[1] [1]

5. A DNS... 6. An active attack is when someone...


A ... assigns a MAC address to each A ... in an organisation exploits their
computer on a network. network access for malicious purposes.
B ... stores domain names and their B ... monitors and intercepts sensitive
corresponding IP addresses. data being transferred on a network.
C ... is used to create a LAN. C ... installs malware on a network
[1] with the intent to harm devices.
[1]

7. Which protocol is responsible for directing 8. IMAP is used for...


data packets between networks? A ... accessing websites.
A Internet Protocol (IP) B ... retrieving emails.
B File Transfer Protocol (FTP) C ... moving and editing files.
C Hyper Text Transfer Protocol (HTTP) [1]
[1]

Section 3: Networks © CGP — not to be photocopied


17
9. Suggest one physical security measure that can help to protect a network.

[I]

10. What are two features of a strong password?

2
[2]

11. Two companies are deciding which network model would suit their offices.

Company A Company B
200 employees 5 employees
Many IT specialists No IT specialists

Suggest why a client-server network may be appropriate for Company A.

Suggest why a peer-to-peer network may be appropriate for Company B.

[4]
15

© CGP — not to be photocopied Section 3: Networks


18

Test 9

There are 12 questions in this test. Give yourself 10 minutes to answer them all.

1. A MAC address... 2. Which of these is likely to have


a more stable connection?
A ... is assigned to a device when
it first accesses a network. A A wired LAN using Ethernet cables.
B ... is required for communication B A wireless LAN using Wi-Fi®.
between devices on the same network. [1]
[1]

3. What type of attack exploits weak 4. POP3 is a protocol which is used to...
input validation on a website? A ... check a packet has arrived
A Phishing at its destination.
B SQL injection B ... access files across a network.
C Denial of service C ... retrieve emails from a server.
[l]

5. A switch is used to.... 6. Which security measure is the best


defence against a passive attack?
A ... transmit data between networks.
A Data encryption
B ... scan data for potential threats.
B User access levels
C ... connect devices on a LAN.
[I] C Anti-malware software
[1]

7. Which of the following statements about 8. A problem with a wired full-mesh


layers of network protocols is true? network is that...
A They discourage developers from A ... the whole network is affected
creating universal software. if a single device has an issue.
B They break network communication B ... there are lots of data collisions.
down into manageable chunks. C ... the more devices you add, the more
[1] expensive it gets to connect them all.
[1]

Section 3: Networks © CGP — not to be photocopied


19
9. Name the protocol that sends encrypted data between a web server and a web browser.

[1]

10. Give two benefits of using a cloud-based application rather


than the same application installed on a local device.

[2]

11. A company network may enforce user access levels. What are user access levels?

[1]

12. Give three reasons why a business may choose to use a LAN instead
of using a number of stand-alone (unconnected) devices.

1.

3.

[3]
15

© CGP — not to be photocopied Section 3: Networks


20

Test 10
There are 12 questions in this test. Give yourself 10 minutes to answer them all.

1. True or False? “Peer-to-peer networks 2. The Internet is an example of a...


do not have a central server.” A ... LAN.
A True B ... WAN.
B False [1]
[1]

3. File hosting is when... 4. A NIC is a piece of hardware that...


A ... a business uses their servers A ... allows a device to
to store the files of an individual connect to a network.
or another business. B ... connects devices on a LAN.
B ... multiple users access C ... transmits data between networks.
a file at the same time.
[I]

5. The rules that govern how devices 6. Penetration testing is...


communicate and transmit data A ... investigating the cause
across a network are called... of an attack on a network.
A ... protocols. B ... detecting malware hidden within
B ... topologies. files downloaded from the Internet.
C ... addresses. C ... identifying weaknesses in a network
[1] through simulated attacks.
[I]

7. Which one of these types 8. The TCP protocol...


of malware self-replicates? A ... splits data into packets.
A Worms B ... encrypts information that
B Trojans is sent and received.
C Viruses C ... is used to send emails.
[1] [1]

Section 3: Networks © CGP — not to be photocopied


21
9. What is a denial of service attack?

[1]

10. A company follows the procedures on the All employees must;


right to protect the security of their network. • Use strong passwords
Give two further procedures which could protect them.
• Regularly update
anti-malware software
1

[2]

11. Outline the differences between IPv4 and IPv6 addresses.

[2]

12. Give two factors that can impact the performance of a wireless home network.

2.

[2]
15

© CGP — not to be photocopied Section 3: Networks


22 Section 4: Issues
Test 11

There are 12 questions in this test. Give yourself 10 minutes to answer them all.

1. Internet censorship is... 2. True or False? “The Data Protection


Act only applies to organisations who
A ... monitoring the websites
store data on their employees.”
that a user accesses on the Internet.
A True
B ... controlling what others can access
and publish on the Internet. B False
[1] [1]

3. Can a company use a copyrighted photo, 4. Large amounts of E-waste is


owned by someone else, on their website? created as a result of people...
A Yes, at any time. A ... frequently upgrading to
the latest electronic devices.
B Yes, with the owner’s permission.
C No, never.
B ... putting electronic devices into
a sleep or hibernation mode.
[I]
[1]

5. Which of these is a valid reason for a 6. A new online banking app could increase
company not to release any data they hold the profits of a bank. Who would be
on a person under the Data Protection Act? affected by the release of the app?
A The company director refuses. A The customers of the bank.
B The data could affect a court case. B The owners of the bank.
C The data could damage the business. C The customers and owners of the bank.
[1] W

7. K person gains unauthorised access to a 8. Proprietary software ...


computer to steal data. This violates the... A ... is usually paid for.
A ... Data Protection Act. B ... can be adapted by users as they need.
B ... Computer Misuse Act. C ... does not get regular updates.
C ... Copyright, Designs and Patents Act. [1]
[1]

Section 4: Issues © CGP — not to be photocopied


23
9. Suggest a legal or ethical issue that is caused by cloud computing.

Pl

10. What is meant by the term ‘cyberbullying’?

[1]

11. Give two ways that manufacturing a computer can negatively impact the environment.

P]

12. A supermarket collects contact details from a customer to notify them of future offers.
The data is stored on an unsecure server before being sold to a company, without
the customer’s permission, who uses the data to make unrelated sales calls.
Explain how this violates the Data Protection Act.

P]
15

© CGP — not to be photocopied Section 4: Issues


24

Test 12
There are 11 questions in this test. Give yourself 10 minutes to answer them all.

1. Intellectual property is... 2. What type of software allows anyone


to legally make modifications
A ... an original idea or piece to its source code?
of work that someone has
created and belongs to them. A Open source
B ... a type of legislation which B Proprietary
protects copyrighted material. [1]
[1]

3. A cultural issue created by 4. In accordance with the Data Protection Act,


the Internet is that... how long should data be kept for?
A ... people can communicate more A Up to 25 years.
easily over large distances. B Only for as long as it is necessary.
B ... face-to-face social interactions C There is no limit.
can be neglected.
[1]
[1]

5. Why might a government restrict 6. True or False? “Most organisations


access to certain websites? need to register with the government
before they can begin collecting data.”
A To protect vulnerable members
of the public, such as children. A True
B To more easily collect data about B False
website browsing habits. [1]
[1]

7. Devices consume large amounts of 8. Which of the following is likely


electricity. This has a negative effect to consume the most energy?
on the environment because... A A desktop computer on standby.
A ... the majority of electricity is made B A smartphone charging.
from non-renewable energy resources.
C A web server receiving a large
B ... producing electricity decreases the amount of client requests.
amount of pollution in the atmosphere.
[1]
[1]

Section 4: Issues © CGP — not to be photocopied


25
9. What is meant by computer surveillance?

[1]

10. Gareth lives in rural Wales and earns a low income.


Why might he have limited access to technology?

R]
What is the name given to the inequality created by people
having different levels of access to technology?

[i]

11. Give three examples of how technology can have


a negative effect on a teenager’s wellbeing.

3.

[3]

© CGP — not to be photocopied Section 4: Issues


26 Mixed Tests for Paper 1

Test 13
There are 12 questions in this test. Give yourself 10 minutes to answer them all.

1. In order to halve a binary 2. True or False? “The purpose of


number, all bits are... systems software is to run and
maintain a computer system.”
A ... shifted 1 place to the left.
A True
B ... shifted 1 place to the right.
B False
C ... shifted 2 places to the right.
[I]
[1]

3. Which of the following generally 4. Which part of the CPU holds


has the lowest average capacity? the memory address for the next
instruction to be processed?
A SSD
A Memory Address Register (MAR)
B Memory card
B Accumulator
C CD-ROM
[1] C Program Counter (PC)
[1]

5. The bit depth of an audio file 6. Which of the following types of malware
is the number of bits... disguises itself as legitimate software?
A ... available for each sample. A Trojan
B ... processed per second. B Worm
[1] C Virus
[1]

7. In which of the following scenarios would 8. SMTP is used to...


using cloud storage be most appropriate? A ... retrieve emails from a server.
A A government organisation storing
sensitive personal details.
B ... send emails and transfer
them between servers.
B A small photography company with C ... access websites and communicate
photographers working remotely. with web servers.
C An author who has limited [1]
access to the Internet.
[1]

Mixed Tests for Paper 1 © CGP — not to be photocopied


Zl
What is a disadvantage of increasing the resolution of an image?

[1]

10. Give two reasons why a star topology is often used on a LAN.

[2]

11. A virtual server is a software-based server. It is possible to run multiple


virtual servers on one physical server. Explain the environmental impact of
using virtual servers on a network instead of multiple physical servers.

P]

12. Describe how a hard disk becomes fragmented.

[2]
15

© CGP — not to be photocopied Mixed Tests for Paper 1


28

Test 14
There are 12 questions in this test. Give yourself 10 minutes to answer them all.

1. How many unique colours 2. Which of the following does an OS use


can a 4-bit image use? to communicate with hardware?
A 8 A Device driver software
B 16 B Defragmentation software
C 24 C Graphical user interfaces
[1]

3. Which CPU would you expect to have the 4. Which of these is not a
greatest performance? A CPU with... Data Protection Act principle?
A ... 4 cores and 1 .5 GHz clock speed. A Data should be kept safe and secure.
B ... 2 cores and 3 GHz clock speed. B Data must be accurate and up to date.
C ... 4 cores and 3 GHz clock speed. C Data cannot be disclosed to anybody.
[I] [1]

5. Which of the following 6. True or False? “Privacy agreements can


data amounts is the largest? legally allow companies to target adverts
at you using your personal information.”
A 400 MB
A True
B 0.3 GB
B False
C 8000 KB
[1] UI

1. If a website has weak input validation, 8. A hacker uses a packet sniffer to


an SQL injection could... intercept and log traffic on a network.
Which type of attack is this?
A ... reveal sensitive information
from a database. A Brute force
B ... upgrade the database B Active
software version.
C Passive
[1]
[1]

Mixed Tests for Paper 1 © CGP — not to be photocopied


29
9. A restaurant introduces a smartphone app that customers can use to place food orders.
Suggest how this decision may affect the waiters of the restaurant.

[1]

10. Describe how an OS manages memory and the CPU


to run multiple applications at the same time.

[2]

11. Convert the denary number 142 into hexadecimal.

[2]

12. Tilly’s computer is running slowly. Explain how upgrading


the RAM could help to improve her computer’s performance.

[2]
15

© CGP — not to be photocopied Mixed Tests for Paper 1


30

Test 15
There are 12 questions in this test. Give yourself 10 minutes to answer them all.

1. FTP is an example of a network protocol. 2. Which of the following correctly calculates


What does FTP stand for? the size of a bitmap image file?
A Firmware Technology Protocol A 2n (where n is the colour depth)
B File Transfer Protocol B image height + image width
C Full Topology Protocol C colour depth x image height
[1] x image width
[1]

3. Which type of task is not handled by a 4. Which of the following statements about
computer’s operating system? external hard disk drives is true?
A Providing a user interface. A They have no moving parts.
B Managing user accounts. B They are portable.
C Updating all open source software. C They are unreliable.
[I] [l]

5. True or False? “A company is likely to 6. Which device initiates communication


own all of its WAN infrastructure.” in a client-server network?
A True A Client
B False B Server
[1] [1]

7. An audio file needs to be compressed. 8. Which type of utility software may


Which of these formats would give increase system performance after use?
a higher quality audio file? A Defragmentation software
A MP3 (a lossy format) B Encryption software
B FLAC (a lossless format) [1]
[1]

Mixed Tests for Paper 1 © CGP — not to be photocopied


31
9. What is a WAP used for?

[1]

10. Convert the binary number 10101110 into hexadecimal.

[2]

11. Give two criminal offences which were introduced with the Computer Misuse Act.

[2]

12. Suggest two features of a password authentication system which


could help to reduce the risk of brute force attacks.

2.

[2]
15

© CGP — not to be photocopied Mixed Tests for Paper 1


32

Test 16
There are 11 questions in this test. Give yourself 10 minutes to answer them all.

1. Blu-ray™ discs can hold around... 2. In a mesh network, all devices...


A ... 250 MB of data. A ... are connected to a single,
centralised switch or server.
B ...2.5 GB of data.
C ... 25 GB of data.
B ... are connected to each other.
[1]

3. Which of the following network 4. Malware that monitors and sends a


protocols is used to retrieve an user’s actions to a hacker is called...
email that is held on a server? A ... spyware.
A HTTP B ... scareware.
B SMTP C ... rootkit.
C POP3 [1]

5. What is the largest denary value that can be 6. Which of the following protects new
represented with one hexadecimal digif inventions, ideas and concepts, such as a
new router design, from being duplicated?
A 10
A Copyright
B 16
B Software licences
C 15
in C Patents
[1]

7. A collection of characters that a 8. How many applications can be processed


computer recognises from their by a single core CPU at the same time?
binary representation is called a... A One
A ... font. B Ten
B ... character set. C Unlimited
nJ [1]

Mixed Tests for Paper 1 © CGP — not to be photocopied


33
9. Complete a 2 place left shift on the 8-bit binary number 00110010.

[1]

10. Sort the following types of storage into the table below.
Magnetic Hard Disk, RAM, ROM, SSD, Magnetic Tape, Cache

Primary Storage Secondary Storage

[2]

11. A company wants to develop an application to manage customer accounts.


Give two positives and two negatives of using an existing piece
of open source software as a starting point for their application.

Positives:

Negatives:

[4]
15

© CGP
— not to be photocopied Mixed Tests for Paper 1
34

Test 17

There are 12 questions in this test. Give yourself 10 minutes to answer them all.

1. A developer wants to compress some 2. The main memory of a computer is its...


software to send to a client. Which A ... RAM.
type of compression cannot be used?
B ... internal hard drive.
A Lossy
C ... virtual memory.
B Lossless
[1]
Hi

3. What is the denary value of 4. Which of the following


the binary number 0010001 1? is equal to 1 petabyte?
A 19 A 1 000 terabytes
B 35 B 1 000 gigabytes
C 36 C 1000 bytes
[i] [1]

5. Network protocols operate on different 6. Which type of memory is the


layers. These layers... fastest for the CPU to access?
A ... overlap each other. A Cache
B ... are independent of each other. B Registers
in C RAM
[1]

7. Which type of attack stops users accessing 8. Which of the following is usually the
a website by flooding the network with weakest point in a computer network?
large amounts of useless traffic? Anti-virus software
A
A Denial of service B The users of the system
B Brute force
C Physical security (padlocks,
C SQL injection CCTV, locked doors, etc.)
Ui W

Mixed Tests for Paper 1 © CGP — not to be photocopied


35
9. Why is secondary storage not affected during a power cut?

10. Convert the hexadecimal number 4F into denary.

[2]

11. Suggest two ways to reduce the risk of health problems when using a computer.

[2]

12. Give one benefit and one drawback of a wired LAN over a wireless LAN.

Benefit:

Drawback:

[2]
15

© CGP — not to be photocopied Mixed Tests for Paper 1


36 Section 5: Algorithms
Test 18
There are 8 questions in this test. Give yourself 10 minutes to answer them all.

1. What is the first step of the 2. Ignoring any information about a


linear search algorithm? problem that isn’t important is called...
A Identify the middle item in the list. A ... decomposition.
B Look at the first item in the list. B ... abstraction.
C Split the list in half. [1]
[1]

3. Which Stop box correctly 4. The flowchart shows...


completes the flowchart? A ... iteration only.
A Stop 1 B ... selection only.
B Stop 2 C ... selection and iteration.
C Stop 3
[1]

5. What does the flowchart represent? 6. What command does the diamond box
represent in the flowchart?
A A clock
A Decision
B A stopwatch
B Sub Program
C A countdown
[I] C Process

Section 5: Algorithms © CGP


— not to be photocopied
37
7. Put the following words into alphabetical order using the insertion sort algorithm.
Orange, Kiwi, Pear, Banana, Apple

[4]

8. Balthazar’s Bookshop calculates an employee’s monthly pay using the algorithm below.

input employeeName
input hoursWorked
total Pay = hoursWorked x 9

Outline what each line of the algorithm does.

[2]
If at least £10,000 of stock is sold in a month, employees now receive a £50
bonus. Complete the flowchart below to calculate and output an employee’s new
monthly pay. The sub program PAY represents the algorithm described above.

PAY

[3]

© CGP — not to be photocopied Section 5: Algorithms


38

Test 19
There are 9 questions in this test. Give yourself 10 minutes to answer them all.

1. Which of the following search algorithms 2. Computational thinking is used to ...


can only be carried out on an ordered list? A ... improve the efficiency of an
A Linear search existing program or piece of code.
B Binary search B ... turn a problem into something
[l] a computer can help you solve.
[1]

3. A programmer solves a complex task 4. An online dictionary uses a program to sort


by writing many small sub programs. a very large list of unordered words into
This is an example of. .. alphabetical order. Which sorting algorithm
would sort the list most efficiently?
A ... decomposition.
A Bubble sort
B ... abstraction.
B Insertion sort
C ... authentication.
[1] C Merge sort
[1]

Questions 5 and 6 are on the following algorithms.

ask user to enter number of litres


input litres
Algorithm 1 pints = litres x 1.76
output pints

Take the number of 1i tres and convert it


Algorithm 2 1nto pints and then output that answer

5. A benefit of using Algorithm 1 6. Each algorithm is written in pseudocode.


over Algorithm 2 is that... An issue with Algorithm 2 is that...
A ... it can be more easily converted A ... it does not use the proper syntax
into a programming language. of a programming language.
B ... it can be interpreted by all B ... it is vague and unstructured.
programming languages. [I]
[1]

Section 5: Algorithms © CGP — not to be photocopied


39
7. Give two advantages of using an insertion sort.

1.

[2]

8. Use a bubble sort to put the following numbers in ascending order,


while showing the order at the end of each pass: 7, 12, 14, 2, 8

[3]

9. A film streaming website uses an algorithm to restrict which films a user can view.
Draw a flowchart to show this algorithm. Your flowchart should:
• Have one input for the user’s age and one input for the age rating of the film.
• Allow or deny access depending on whether the user is old enough to view the film.

[4]
15

© CGP — not to be photocopied Section 5: Algorithms


40 Section 6: Programming
Test 20
There are 9 questions in this test. Give yourself 10 minutes to answer them all.

1. A procedure... 2. True or False? “Records can only contain


values which are all of the same data type.”
A ... always takes at least one parameter.
A True
B ... never returns a value.
[1] B False
[1]

3. Which of the following data types 4. Which expression evaluates to true?


could store the value 45.31? A 3 < 5 AND 1 > 2
A Integer B 1 != 1 OR 4 < 5
B Real C N0T(7 > 3)
C Boolean [1]
[1]

Questions 5 and 6 are on the following table and SQL statement.

Table: seatingPlan
ID firstName lastName dateOfBirth seatNum
1 Humza Ahmed 08/02/1993 4B
2 Janet Swan 13/12/1986 13K
3 Ollie Fisher 29/05/1996 24A
4 Agata Kowalski 10/03/1990 7D

SELECT firstName, dateOfBirth FROM seatingPlan WHERE seatNum = 24A

5. What will the SQL statement above return? 6. Which SQL statement would
return all records in the table?
A Humza 08/02/1993
A SELECT ID FROM seatingPlan
B Fisher 29/05/1996
B SELECT * FROM seatNum
C Ollie 29/05/1996
C SELECT * FROM seatingPlan
[1]
[1]

Section 6: Programming © CGP — not to be photocopied


41
7. What is meant by casting?

[1]

8. The nth square number can be found by adding up the first n odd numbers.
Complete the algorithm below to write the first 10 square numbers
to a text file called ‘output.txt’ and close the file.

01 nums = open( )
02 sqNum = 0

03 for n = 1 to 19 step

04 sqNum = sqNum + n

05

06 next n

07
[4]

9. The array scoresArch holds the Archer


scores of five archers in a competition.
0 1 2 3 4
scoresArch[l , 2] contains the value 8.
0 5 3 10 6 8
Write a line of code to insert a score
of 7 into the empty element in the array. Shot 1
2
3
4
1
1
8
9
7
10
7

[1]
Write a function that takes the array and an archer number
as parameters and returns an archer’s total score.

[3]

© CGP — not to be photocopied Section 6: Programming


42

Test 21
There are 11 questions in this test. Give yourself 10 minutes to answer them all.

1. What will 23 DIV 4 return? 2. True or False? “The value of a


constant can’t be modified whilst
A 6
a program is running.”
B 3
A True
C 5
B False

Questions 3 and 4 are on the following array.

01 array goals [2, 2]


02 goals[0, 0] = 5
03 goals[0, 1] = 11
04 goals[l, 0] = 4
05 goalstl, 1] = 7

3. goal s is an example of a... 4. Why is it appropriate to store


A 1D array with 4 elements this data in an array?

B 2D array with 4 elements A No data uses the string data type.

C 2D array with 2 elements B All the data is of the same data type.
[1]
[1]

5. Which logic gate gives an output of 1 6. Parameters are...


if either input is 1?
A ... types of variable used to pass
A AND gate information into a sub program.
B NOT gate B ... the actual information that
C OR gate is passed into a sub program.
[1]
[1]

7. What does ASC ( c ) do? 8. A program deploys the rear wing of a


A Returns the ASCII code supercar when the variable speed is greater
for the character “c”. than 70. Which of the following would
be the most appropriate in this program?
B Returns t r u e if “c” is in
the ASCII character set. A An IF statement.
[1] B A SWITCH statement.
[1]

Section 6: Programming © CGP — not to be photocopied


43
9. A user registers on a website with the details on the right. fi rstName = "John"
State the output of the following lines of code: lastName = "Jones"
age = "34"

printcage. length)

printC'Mr. " + lastName. upper)


[2]
Write program code to print a random character from fi rstName.

[2]

10. Give one benefit of an IF-ELSEIF statement over a SWITCH statement.

[1]

11. The table flightPaths below shows information about flights from UK airports.
flightNumber depAirport destAirport depTime
AA442 Manchester New York 09:45
A7757 Liverpool Las Vegas 11:33
F142 Liverpool Menorca 08:30
KL114 Heathrow Edinburgh 16:42

Write an SQL statement to return:


the flight number and destination of all flights departing from Liverpool

[1]

the departure airport and departure time for flight F142

[1] 15

© CGP — not to be photocopied Section 6: Programming


44

Test 22
There are 9 questions in this test. Give yourself 10 minutes to answer them all.

1. Which logic gate gives an output of 0 2. Given that x = "CompSci " and
if both inputs are 0? test = x.subString(4,l),
what is the output of pri nt(test )?
A AND gate
A S
B OR gate
B p
C Both AND and OR gates
[1] C Comp
[I]
Questions 3 to 6 are on the following program.

highScore = 89
playerScore = i nput( "Pl ease enter your score")
if playerScore < 1 OR playerScore > 100 then
pri nt (" Inval i d score entered")
elseif playerScore > highScore then
print("New high score, well done!")
elseif playerScore < highScore then
print("You did not beat the high score")
el se
printC'You equalled the high score!")
endi f

3. The hi ghScore variable has 4. The flow of the program is


an integer data type. Using the controlled using...
correct data type makes code...
A ... a selection statement.
A ... less memory efficient.
B ... an iteration statement.
B ... more robust. C ... both selection and
[1] iteration statements.
[1]

5. Which of these inputs would result in the 6. What would the program output
output Inval i d score entered? if the input was 90?
A 1 A You equalled the high score!
B 1.1 B New high score, well done!
C 101 C You did not beat the high score
[1] [1]

Section 6: Programming © CGP — not to be photocopied


45
7. Explain the difference between the = operator and the == operator.

[2]

8. Why is it suitable to use the string data type to store a postcode?

[I]

9. Mike has written three procedures:


A. 1i stl)sers( ) B. createUser( ) C. del eteliser ( )
Write program code using a SWITCH statement which:
• asks a user to input a letter and runs the matching procedure,
e.g. an input of "B" runs the createllser procedure.
• displays a message if an input has no matching procedure.

[4]

Mike defines a local variable in the 11 stUsers procedure.


He later tries to reuse the variable outside of the procedure. Explain what will happen.

P]
15

© CGP — not to be photocopied Section 6: Programming


46

Test 23

There are 9 questions in this test. Give yourself 10 minutes to answer them all.

1. Which operator is used to 2. Which of the following numbers could


raise a number to a power? be generated using random!1 , 10)?
A DIV A 10

B A
B 5.0
C MOD C 15
[1] [1]

Questions 3 to 6 are on the following program.

01 warningSiren = false
02 temp = input!) //temp is the initial temperature of the reactor.
03 rads = inputt) //rads is the initial radiation of the reactor.
04 if rads < 0.3 then
05 while temp < 300
06 pri ntt "Temperature is at " + str(temp) + " degrees.")
07 runReactort) //Activates reactor. Increases value of temp.
08 endwhile
09 endif
10 warningSiren = true //Plays warning siren in facility.
11 pri ntt "Evacuate the facility now!")

3. Why is casting needed in line 06? 4. When does the WHILE loop
A There are more than two strings check the value of temp?
being concatenated. A During the loop.
B temp has a real data type but needs B At the end of the loop.
to be concatenated with a string.
C At the start of the loop.
[I]
[1]

5. Which of the following statements is true? 6. If 0.3 is the initial radiation and 90 is the
A The values of rads and temp determine initial temperature, what is the first string
whether a warning siren plays. that would be output by the program?

B The value of warni ngSi ren A Temperature is at 90 degrees.


determines if a message is printed. B Evacuate the facility now!
[1]

Section 6: Programming © CGP


— not to be photocopied
47
7. Complete the following truth table.
A B c AANDB NOTC X = (A AND B) OR (NOT C)
0 0 0 1
0 0 1 0
0 1 0 1
0 1 1 0
1 0 0 1
1 0 1 0
1 1 0 1
1 1 1 0
[2]

8. The words below are stored in an array called pets .


rex summer fudge mickey rebel
Complete the algorithm to change the contents of the array to all uppercase.
01 1=0

02 do

03 pets[i ] =

04 1=1+1

05 until 1 ==
[2]
Explain the effect of deleting line 04.

[2]

9. Write a function called average which takes three integer parameters and returns
their average (mean). Only the whole number part of the average should be returned.

[3]
15

© CGP — not to be photocopied Section 6: Programming


48 Section 7: Design, Testing and IDEs
Test 24
There are 12 questions in this test. Give yourself 10 minutes to answer them all.

1. A program only allows users to 2. A good test plan should...


input an integer between 0 and 1 0. A ... outline what will be tested
This is an example of... and how it will be tested.
A ... input diagnostics. B ... only test for one potential way
B ... input validation. a user may misuse a program.
[1] [1]

3. A program requires the user to enter their 4. Which of these is not a part
age in whole years. Which of the following of defensive design?
test data for the program is not erroneous? A Anticipating how a program may
A 4£ be used incorrectly in the future.
B 64 B Authenticating users of a program
to prevent unauthorised access.
C -28.0
[1] C Encrypting a program so it
cannot be deciphered.
[1]

5. Which of these translators will stop when 6. Iterative testing takes place...
they reach the first error in a program? A ... during development.
A Compiler B ... after development is complete.
B Interpreter [I]
[1]

1. Structure diagrams break a program down 8. Which of these is a valid way of reducing
into modules. What is an advantage of this? the number of characters in a program
without compromising its functionality?
A Multiple programmers can work on
the same module at the same time. A Removing all indentation.
B A module can be fixed without B Renaming all variables as single
affecting the rest of the program. letters (“a”, “b”, “c” etc.)
C The program will contain fewer errors. C Replacing repeated code with
[1] functions or procedures.
[1]

Section 7: Design, Testing and EDES © CGP — not to be photocopied


49
9. What is a logic error?

[1]

10. Describe a feature of an IDE which can be used to identify logic errors.

[1]

11. The formula for triangle number n 01 procedure tri Numbers ( n )


is 0.5 n(n + 1). The procedure on 02 for i = 1 to n
the right takes a parameter n and 03 triangle =0.5* i* (1+1)
prints the first n triangle numbers. 04 pri nt(tri angl e)
05 next i
06 endprocedure
Complete the trace table below
when tri Numbers (4) is called.

n i triangle
1

2
6

[3]

12. Why is it important to keep code well-maintained?

[2]
15

© CGP — not to be photocopied Section 1: Design, Testing and IDEs


50

Test 25
There are 10 questions in this test. Give yourself 10 minutes to answer them all.

1. True or False? “Trace tables can help 2. A compiler...


identify any logic errors within code.” A ... translates and runs the source
A True code one instruction at a time.
B False B ... translates all of the source code
[1] and creates an executable file.
[1]

3. Final (terminal) testing is used... 4. Which part of an IDE may include


... to test that each individual module of automatic features to format comments?
A
a program works correctly in isolation. A Run-time environment
B ... to test for errors in the main program B Breakpoints
when modules interact with each other.
C Code editor
[1]
[1]

5. Which of the following statements 6. Error diagnostic tools...


about modules is correct? A ... can identify syntax errors in code
A A module is a smaller part and give the location of the errors.
of a larger program. ... auto-correct any logic errors in code
B
B A module cannot be reused to and give the location of the errors.
write a program in the future. [1]
[1]

7. Asking a user to enter a username 8. A software company is developing a


and password is a type of. .. program for an embedded system with
A ... validation. limited memory. Which type of language
would be most appropriate to write in?
B ... encryption.
A High-level language
C ... authentication.
B Low-level language
[1]
[1]

Section 7: Design, Testing and IDEs © CGP — not to be photocopied


51
9. Kaira needs to create an email address. Give two input validation checks
that may be used to check her email address is in an acceptable format.

2
[2]

10. The program below takes an input and returns a student’s grade.

01 number = input( "Pl ease enter your mark")


02 total = 80
03 percentage = number/total * 100
04 if (percentage >= 70 AND percentage <= 100) then
05 printCYou have achieved a grade A")
06 elseif (percentage >= 50 AND percentage < 70) then
07 print("You have achieved a grade B")
08 elseif (percentage >= 30 AND percentage < 50) then
09 printCYou have achieved a grade C”)
10 el se
11 printCYou have failed")
12 endi f

Give two ways, using examples from the code, of how


the maintainability of the program could be improved.

2
[2]
The program does not work when erroneous data is input.
Complete the test plan below to test for other potential issues of the program.

Type of data Test data Reason for testing Actual Outcome

“You have achieved


40
a grade C”

To ensure the program can


90 handle inputs of the correct data
type that should be rejected

Boundary 80

[3]
15

© CGP — not to be photocopied Section 7: Design, Testing and IDEs


52 Mixed Tests for Paper 2
Test 26
There are 11 questions in this test. Give yourself 10 minutes to answer them all.

1. What information should be given about 2. TrueorFalse? “random(0, 10) generates


each field when creating a record structure? a random integer between 1 and 9.”
A Data type and field name A True
B Data type and field length B False
C Data arguments and field length [1]
[1]

3. Combining two string variables is called... 4. A DO UNTIL loop is controlled


by a condition...
A ... concentration.
B ... coordination.
A ... at the start of the loop.
B ... at the end of the loop.
C ... concatenation.
[I]
[I]

5. A binary search is performed on a list of 6. When testing a program,


5 items. What is the greatest number of boundary data should be used to...
comparisons needed to find an item?
A ... test that the program correctly
A 2 processes inputs at the limit of
what it should be able to handle.
B 3
C 4
B ... test that the program can
handle invalid inputs.
[1]
[1]

7. Developing a logical set of instructions to 8. Which of the following statements is false?


solve a particular problem is known as...
A A function can have more
A ... abstraction. than one parameter.
B ... decomposition. B A function never returns a value.
C ... algorithmic thinking. C A function is a type of sub program.
[1] [1]

Mixed Tests for Paper 2 © CGP — not to be photocopied


53
9. Which set of input values will give an output of 1 in the logic circuit below?
Input A
Output R
Input B ,B=
[1]
Write the logic statement for the logic circuit.

R=
[1]

10. All guests of a hotel must rate their stay on a scale from 1 to 5 when checking out.
Complete the flowchart below to:
• ask a guest to enter their name and a rating (1, 2, 3, 4 or 5).
• output a message that thanks the guest with their name if a valid input is entered.
• output an appropriate message if an invalid input is entered.

ft

11. Explain how global variables can sometimes cause problems in large
programs and why local variables are often preferred by developers.

[2]
15

© CGP — not to be photocopied MixedTests for Paper 2


54

Test 27

There are 9 questions in this test. Give yourself 10 minutes to answer them all.

1. A sub program flowchart box is used... 2. Which of the following is an


example of a logic error?
A ...to show the start of an iteration.
A A D I V operator is used
B ... at the start of a decision.
instead of a MOD operator.
C ...to reference another flowchart.
B A function is called but a
[1]
bracket is missing.
[1]

Questions 3 to 6 are on the following table and SQL statement.

Table: boats
make model engineType radarFitted engineSize
Swift Racer Petrol False 2.5
June Spirit Petrol False 1.4
Swift Ranger Diesel True 2.0
Ocean Crawler Enterprise Diesel True 1.6

SELECT FROM boats WHERE engineSize < 1.6

3. Which of these statements is correct? 4. What field name is missing from the SQL
statement above if ‘Spirit’ is returned?
A Each row of the table is an array.
A engineSize
B Each row of the table is a record.
[1] B model
C engineType
[1]

5. Which data type is most appropriate 6. What is an appropriate validation check


for the field rada rFi tted? to use on the field engi neSi ze?
A String A Check all data is greater than 0.
B Character B Check all data is "True" or "False".
C Boolean C Check all data is less than 2.0.
[1] [1]

Mixed Tests for Paper 2 © CGP — not to be photocopied


55
The function on the right takes num as a parameter. function mystery(num)
Complete the first four rows of the trace table count = 0
below when my s t e ry ( 10 ) is called. for i = 1 to num
if num MOD i == 0
num i num MOD i count count = count + 1
endi f
10 - - 0 next i
return count
endf uncti on

[3]

What is the purpose of the function mystery ( )?

[1]

8. A merge sort is being carried out on the following letters: ZCGALBTF


The algorithm has already split the list so that each letter is in its own list.
Complete the algorithm to put the letters in alphabetical order.

[3]

9. Give two benefits of a programmer using a high-level language


rather than a low-level language.

2.

[2]
15

© CGP — not to be photocopied Mixed Tests for Paper 2


56

Test 28
There are 11 questions in this test. Give yourself 10 minutes to answer them all.

1. Which of the following 2. Which type of flowchart box is


statements evaluates to 2? a rectangle with rounded corners?
A 11 MOD 3 A Sub Program
B 10/3 B Start/Stop
C 3 DIV 2 C Decision
[I] [1]

3. What would the logic statement 4. What would be the output of


33 > 10 OR 5 < 3 evaluate to? fi r st name . 1 eft( i )?
A TRUE A The first 1 characters of f 1 rstname.
B FALSE B The final i characters of f i rstname.
[1] C The string f i rstname, excluding
the character in position i .
[1]

5. Which of the following can improve the 6. How many possible combinations of inputs
maintainability of a program? are there for a logic circuit with 3 inputs?
A Using multiple forms of authentication. A 8
B Using sub programs. B 10
C Removing all comments. C 9
[I] [1]

7. Which of these would not make a password¬ 8. Which of the following


based authentication system more secure? is a type of data structure?
A Enforce users to change their A A trace table
password every month. B A procedure
B Enforce users to use no numbers C A record
or symbols in a password.
[l]
[1]

Mixed Tests for Paper 2 © CGP — not to be photocopied


57
9. Rajesh has written the procedure below to simulate 10 rolls of a 20-sided dice.
01 procedure diceRollO
02 for n = 1 to 10
03 roll = randomd.O to 20.0)
04 next n
05 print(roll )
06 endprocedure

There are two errors in his code.


Suggest how you would refine his procedure so that it works as intended.

[2]

10. Describe two features of an IDE that can make writing a program easier.

[2]

11. The sales array holds the sales of a shop for each day of the week.
For example, s a 1 es [ 0 ] holds the sales for Monday.

Complete therollingSales function below that takes an integer parameter, num,


and returns the total sales for that many days, starting from Monday.
For example, rol 1 i ngSal es ( 2 ) should return the total sales for Monday and Tuesday.

function rollingSales(num)

endfunction
[3]
15

© CGP — not to be photocopied MixedTests for Paper 2


58

Test 29
There are 8 questions in this test. Give yourself 10 minutes to answer them all.

1. A program that compiles successfully 2. Which logic gate only takes a single input?
but does something unexpected when
A NOT
it is running contains...
B AND
A ... syntax errors.
C OR
B ... logic errors.
[1]
W

3. Which of these commands is required first 4. Which of these lines of code does
when reading data from a text file? not use a comparison operator?
A readL1ne() A x = 9 * 8
B open() B y = 10
C dataReadC ) C z > 7
[1] [1]

Questions 5 and 6 are on the following flowchart.

5. Which programming construct 6. Which of these commands should be used


is used at the diamond box? in the empty box to update Record?
A Selection A Record = Speed
B Sequence B Speed = Record
C Iteration C Record = Record + Speed
[1] [I]

Mixed Tests for Paper 2 © CGP — not to be photocopied


S9
7. Sophia wants to develop a recipe app for her smartphone. The app will ask
a user to input ingredients and will return a list of recipes that can be made.
Part of a structure diagram for the app is shown below.

Suggest a module or task that would be appropriate for Box A and Box B.

Box A:

Box B:
[2]
Which technique of computational thinking is shown with a structure diagram?

[I]

The text file ‘mass.txt’ on the right shows the masses of five objects. mass.txt
A scientist wants to write a program to analyse these values. 332.1
461.4
Write program code that reads each value from ‘mass.txt’ and puts 74 1
them into a different element of an array called data. 24.6
Your program must contain: 100.0
• a WHILE loop. • the endOffile() command.

[6] 15

© CGP — not to be photocopied Mixed Tests for Paper 2


60

Test 30

There are 11 questions in this test. Give yourself 10 minutes to answer them all.

1. Which is the most suitable data 2. What does SQL stand for?
type to store the value 1 .7?
A Systematic Query Library
A Integer
B Scripted Query Look-Up
B Real
C Structured Query Language
C Character Hl
[1]

3. True or False? “Defensive design 4. Given that ci ty Na me = "Liverpool",


involves anticipating how a user which of these would output "erp”?
may misuse a program.”
A ci tyName. subStri ng(3 , 3)
A True
B cityName.String(3,5)
B False
C ci tyName . subStri ng (4 , 3 )
[1]
[1]

5. An algorithm written in pseudocode... 6. What are breakpoints used for in an IDE?


A ... should always use the proper syntax A To show lines of code that
of a programming language. don’t have any comments.
B ... can show the same solution to a B To provide syntax highlighting.
problem that a flowchart can.
C To pause the program on specific lines
[I] to allow for further investigation.
[1]

7. Which of the following statements would 8. A list has 4 items. What is the maximum
evaluate to TRUE when a = 49? number of comparisons needed to sort
A a > 49 AND a < 49 the list using an insertion sort?
B a >= 50 OR a <= 75 A 4
C a != 49 B 6
[I]
C 8
[1]

Mixed Tests for Paper 2 © CGP — not to be photocopied


61
9. Complete the truth table below.
A B AANDB NOT (A AND B)
False False
False True
True False
True True [2]

10. The program below counts the number of prizes left in a competition.
01 beachprize = 100
02 ski prize = 50
03 code = inputCEnter a code for a chance to win’")
04 switch type:
05 case "Beachl08":
06 beachprize = beachprize - 1
07 printCYou have won a beach prize!")
08 case "Ski209" :
09 ski prize = ski prize - 1
10 printCYou have won a ski prize!"
11 case default:
12 printCYou have not won this time!")

Identify three errors in this program.

3
[2]

11. The start of a function for a search algorithm is shown below.

function sea rchAl gori thm( f Ar ray , fltem)


startArray = 0
endArray = len(fArray) - 1 //len returns the size of an array,
while startArray != endArray
midArray = (startArray + endArray) DIV 2

Identify the algorithm the function represents. Give a reason for your answer.

[2]

© CGP — not to be photocopied Mixed Tests for Paper 2


62

Answers
Section 1: Components
of a Computer System
Test 3
1.
— Pages 6-7
B [1 mark] 2. A [1 mark]
7. B [1 mark] 8. A [1 mark]
9. z is the next character after y,

1.

Test 1 Pages 2-3
C [1 mark] 2. A fl mark]
3.
5.
7.
A [1 mark]
A [1 mark]
C [1 mark]
4. C [1 mark]
6. B fl mark]
8. C [1 mark]
so it is one binary value greater:
0111 1010 /2 mar*/
File size = no. of bits per character
3. B [1 mark] 4. C [1 mark] 9. Compressing the file will reduce the x no. of characters [1 mark]
5. A [1 mark] 6. A 11 mark] size of the file, so it will take up less
7. A [1 mark] 8. B [1 mark]
= 8 x 30 = 240 bits [1 mark]
storage space / will be quicker to 10. 5 = 5 in denary and 0101 in binary.
9. E.g. dishwasher I microwave / TV / transfer over the Internet [1 mark]. E = 14 in denary and 1110 in binary.
washing machine [1 mark] 10. The accumulator stores intermediate Put the nibbles together to get
10. It can make a computer slow to results of calculations performed 01011110/2 mark for working,
respond when switching between by the ALU [1 mark]. 1 mark for correct answer]
applications or performing 11. Any two from: e.g. Password / PIN 11. E.g. Benefit: the digital recording
memory-intensive tasks [1 mark]. / User-access levels / Fingerprint will be of higher quality / closer to
11 . E.g. Encryption software scrambles scanner / Retina scanner [2 marks] the original vocals [1 mark].
data so it can't be read [1 mark]. 12. E.g. USB Flash Drive [1 mark] Drawback: the size of the audio file
The intended reader can decrypt the
Any two from: e.g. USB flash drives will increase [1 mark].
data with the correct ‘key’ [1 mark].
12. E.g. The Control Unit sends
signals to load the address of the
offer appropriate storage capacity
for the files. / They are small and
Test 6
1.
— Pages 12-13
B [1 mark] 2. C [1 mark]
program counter into the MAR portable. / They are robust and 3. B [1 mark] 4. A [1 mark]
[1 mark]. The data/instruction unlikely to get damaged. / Most 5. B [1 mark] 6. A [1 mark]
in that memory address is then laptops have USB ports, so it is 7. C [1 mark] 8. A [1 mark]
fetched from memory and stored appropriate for students. [2 marks] 9. ^^Wflmark]
in the MDR [1 mark}. The PC is 00001101 [1 mark]
incremented to point to the address Section 2: Data shiftR(l 1011001) returns an answer
of the next instruction [1 mark]. Representation where the ‘1001’ bits have been lost,
Test 2
1.
— Pages 4-5
B [1 mark] 2. B [1 mark]

Test 4 Pages 8-9
1. C [1 mark] 2. C [1 mark]
so the fractional part of the division
would not be included [1 mark],
3. B [1 mark] 4. B [1 mark] 3. A fl mark] 4. B [1 mark] 10. E.g. Compression makes the
5. C fl mark] 6. C [1 mark] 5. A fl mark] 6. kflmark] file smaller in size [1 mark], so
7. A [1 mark] 8. C [1 mark] 7. B fl mark] 8. A [1 mark] it will be faster to upload and
9. To process data and instructions 9. send via email [1 mark].
0 10 10 10 1
to make a computer system 11. The new binary number is 10010001,
+ 01101101
function correctly [1 mark]. 1 1 000010
which is 128 + 16 + 1 = 145 as a
10. Any two from: e.g. Provide a 1 1 1 I l 1 denary number [1 mark for working,
user interface. / Handle file and [1 mark for working, 1 mark 1 mark for correct answer].
disk management. / Manage user for correct answer]
accounts and security. / Control 10. Overflow is when a calculation Section 3; Networks

11.
the CPU and memory resources.
[2 marks]
Any two advantages: e.g. The SSD
[1 mark] produces an answer
that has more bits than the CPU
was expecting [1 mark]. 1.

Test 7 Pages 14-15
A [1 mark] 2. Afi mark]
will not require defragmenting. 11. Lossless compression fl mark]. 3. B [1 mark] 4. C [1 mark]
5. A fl mark] 6. A [1 mark]
/ The SSD will withstand shocks Data is temporarily removed from 7. C [1 mark] 8. Bflmark]
better than the HDD. / The SSD the image, which is then restored 9. Star topology [1 mark]
is silent. [2 marks] when the image is opened [1 mark]. 10. E.g. A weak password is easier
Any two disadvantages: e.g. The Therefore, the photographer can to guess, so his account could
SSD is likely to cost more than the recover the original high-quality be broken into via a brute force
HDD. / The SSD is likely to have a image as no data is lost [1 mark]. attack fl mark]. The anti-malware
lower capacity than the HDD. / The
SSD has a shorter read/write life and
Test 5
1.
— Pages 10-11
A. [1 mark] 2. A [1 mark]
software may not detect newer
versions of malware attempting
will deteriorate over time. [2 marks] 3. A [1 mark] 4. A [1 mark] to be installed [1 mark].
5. C [1 mark] 6. C [1 mark]
Answers © CGP — not to be photocopied
63

Answers
11. Any two advantages: e.g. Files can 11. User access levels control 10. Cyberbullying is when somebody
be accessed from any device with which parts of a network that uses social media to deliberately
Internet access. / Security and different groups of users can harm somebody else [1 mark],
backups are provided. I Saves space and cannot access [1 mark]. 11. E.g. Manufacturing requires large
on hard drives, reducing the need to 12. Any three from: e.g. Files can be amounts of energy, which creates
buy larger hard drives. [2 marks] shared easily. / Devices such as pollution [1 mark]. Large amounts
Any two disadvantages: e.g. Files printers can be shared across the of raw materials are used [1 mark].
cannot be accessed without an business. I Devices can share an 12. E.g. The Data Protection Act gives
Internet connection. I Reliant on the Internet connection. / Employees can certain rights to customers which
cloud host to ensure data is secure. I log on to their accounts from any aren’t being considered by the
Subscription fees can be expensive device on the network. [3 marks] supermarket [1 mark]. E.g. the data
in the long term. [2 marks] Test 10 — Pages 20-21 is not being used for its specified
Test 8 — Pages 16-17 1 . A [1 mark]
3. k[lmark]
2. 3 [1 mark]
4. X [1 mark]
purpose [1 mark], and is being
used in an unlawful way [1 mark].
1.
3.
5.
C [1 mark]
A [1 mark]
B [1 mark]
2. B ]1 mark]
4. B [1 mark]
6. C[lmark]
5. K[lmark]
7. A [1 mark]
6. C [1 mark]
8. A [1 mark]
Test 12
1.

A [1 mark]
Pages 24-25
2. A [1 mark]
7. A [1 mark] 8. 3 [1 mark] 9. A DoS attack is where someone 3. B [1 mark] 4. B {1 mark]
9. E.g. Lock network hardware like tries to stop users accessing part of 5. A [1 mark] 6. A [1 mark]
servers in a secure room and only a network or website by flooding a 7. A [1 mark] 8. C [1 mark]
give keys to trusted people [1 mark], network with traffic [1 mark]. 9. Computer surveillance is when
10. E.g. It is many characters in length 10. Any two from: e.g. Pentest the someone monitors what people are
[1 mark]. I It contains a mixture of network regularly. / Enforce user doing on their computers [1 mark].
letters and symbols etc. [1 mark]. access levels to limit access to 10. He is likely to live in an area
11. E.g. Company A has IT specialists sensitive data. / Use firewalls. I with poor reception quality and
which could install and update all Encrypt all sensitive data. [2 marks] broadband speed [1 mark]. He may
employees* software at the same 1 1. E.g. IPv4 addresses use 32 bits not be able to afford new technology
time in a client-server network whereas IPv6 uses 1 28 bits [1 mark]. with his low income [1 mark].
[1 mark]. It will be easier to keep IPv4 addresses are given as four The digital divide [1 mark].
track of and backup files as they denary numbers whereas IPv6 are 11. E.g. Teenagers can experience
are stored centrally [1 mark]. given as eight hex numbers [1 mark]. cyberbullying or trolling on social
Company B has no IT specialists.
12. Any two from: e.g. Number of media sites [1 mark]. / Teenagers
devices connected to the network. may come across inappropriate
A peer-to-peer network would
be easy to set up and maintain
I High-bandwidth activities, such material or be at risk of exploitation
[1 mark] and wouldn’t require
as streaming or online gaming. / on the Internet [1 mark]. / Teenagers
Interference from obstacles, such are pressured into always having the
any expensive hardware or
IT specialists [1 mark].
as walls. / Interference from other latest device by their peers [1 mark].
nearby wireless networks. [2 marks]

Test 9 Pages 18-19
1. B [1 mark] 2. A [1 mark] Section 4: Issues
Mixed Tests for Paper 1
3. B [1 mark]
5. C [1 mark]
4. C [1 mark]
6. A [1 mark] Test 11 — Pages 22-23
Test 13
1.
— Pages 26-27
B [1 mark] 2. A ]1 mark]
7. B [1 mark] 8. C [1 mark] 1. B [1 mark] 2. 3 [1 mark] 3. C [1 mark] 4. C [1 mark]
9. HTTPS I HTTP Secure / HyperText 3. B [1 mark] 4. A [1 mark] 5. A [1 mark] 6. A [1 mark]
Transfer Protocol Secure [1 mark] 5. B [1 mark] 6. C [1 mark] 7. B [1 mark] 8. B [1 mark]
10. Any two from: e.g. The cloud app 7. B [1 mark] 8. A [1 mark] 9. The size of the image file
can be accessed on any device. / 9. E.g. Users of the cloud have to trust will increase [1 mark].
Cloud apps are run on the cloud the company storing their data to 10. Any two from: e.g. If a device fails
service provider’s hardware, so you protect it against loss or hackers. / or is disconnected, the rest of the
do not need a powerful computer Users may not fully understand network is unaffected. / It is easy
to run memory-intensive apps. / how the company uses their to add new devices to the network.
The cloud service provider data if they have not read the / Data goes straight to the central
will keep the app up-to-date privacy agreement. [1 mark] device, reducing the chance for data
so you don’t have to. [2 marks] collisions. ]2 marks]
© CGP — not to be photocopied Answers
64

Answers
1 1 . E.g. Fewer physical servers are
needed, so fewer natural resources
Test 16
1.
— Pages 32-33
C /7 mark] 2. B /7 mark]
8. Lines 1 takes an input and stores
the result as employeeName.
Line 2 takes an input and stores
are used to build them /7 mark! 3. C /7 mark] 4. A /7 mark]
and less energy is needed to 5. C /7 mark] 6. C /7 mark] the result as hoursWorked.
keep them running /7 mark]. 7. B /7 mark] 8. A /7 mark] Line 3 multiplies the input from
12. Gaps on a hard disk appear when 9. 11001000 ] I mark] Line 2/ hoursWorked by 9.
files are moved, deleted or change 10. Primary Storage Secondary Storage
[1 mark for one correct line,
size [1 mark]. New files are saved 1 mark for all other correct lines]
RAM Magnetic Hard Disk
in different gaps /7 mark].
Test 14
1.
3.

B /7 mark]
C /7 mark]
Pages 28-29
2. A /7 mark]
4. C [1 mark]
ROM
Cache
SSD
Magnetic Tape
[2 marks for all correct, 7 mark for
any four answers sorted correctly]
5. A /7 mark] 6. A /7 mark] 1 1 . Positives: e.g. Open source software
7. A /7 mark] 8. C /7 mark] is often free, reducing development
9. E.g. Fewer waiters may be needed, so cost /7 mark]. / It can be modified to
some could lose their jobs /7 mark]. fit the company’s needs /7 mark].
10. The OS manages memory resources Negatives: e.g. Open source software
so that applications do not interfere may not get regular updates, which
with each other /7 mark]. The OS leads to bugs etc. /7 mark]. I There is /7 mark for decision box with
divides CPU time between open limited user documentation, making appropriate question, 7 mark for
applications, prioritising certain it harder to learn /7 mark]. calculating new total pay,
processes, so that instructions are
executed efficiently /7 mark].
E.g. 142 16 = 8 r 14/7 mark]
Test 17

A /7 mark]
Pages 34-35
2. A /7 mark]
7 mark for output]
Test 19
— Pages 38-39
14 is E in hexadecimal, so 142
3. B /7 mark] 4. A /7 mark] 1. B /7 mark] 2. B /7 mark]
is 8E in hexadecimal /7 mark] 5. B /7 mark] 6. B /7 mark] 3. A /7 mark] 4. C /7 mark]
7. K /7 mark] 8. B /7 mark] 5. A /7 mark] 6. B /7 mark]
1 2. She would have higher capacity/
speed in primary storage /7 mark], 9. Secondary storage is non-volatile, so 7. Any two from: e.g. They can handle
so the CPU could have quicker retains data without power /7 mark]. small lists very efficiently. / They
access to more data /7 mark]. 10. (4 x 16) = 64 and F = 15, /7 mark] are very memory efficient as all
Test 15
1.

B /7 mark]
Pages 30-31
2. C /7 mark]
so 4F = 64 + \5 = 19[1 mark]
Any two from: e.g. Take regular
breaks. I Sit with a correct posture.
sorting is done in the original list.
/They can quickly check if a list
is already sorted. /2 marks]
3. C /7 mark] 4. B /7 mark] I Sit a reasonable distance from the 8. First pass: 7, 12, 2, 8, 14 /7 mark]
5. B /7 mark] 6. A /7 mark] screen. / Use suitable lighting / etc. Second pass: 7, 2, 8, 12, 14 /7 mark]
7. B /7 mark] 8. A /7 mark] /2 marks] Third pass: 2, 7, 8, 12, 14 /7 mark]
9. X WAP allows devices to connect 12. Benefit: e.g. Wired connections are Fourth pass: no swaps, list is ordered.
wirelessly to a LAN /7 mark]. usually faster than wireless /7 mark]. 9.
10. Split into nibbles: 1010, 1110. Drawback: e.g. More wiring
1010= A and 1 1 10 = E /7 mark] is needed to add devices to
So 1 0 1 0 1 1 1 0 is AE in hex /7 mark] the network /7 mark].
1 1. Any two from: Gaining unauthorised
access to a private network or device Section 5: Algorithms
through hacking. / Accessing a
network or device in order to commit
a crime. / Purposefully spreading
Test 18
— Pages 36-37
B /7 mark] 2. B /7 mark]
malware. /2 marks] 3. B /7 mark] 4. C /7 mark]
12. Any two from: e.g. Make users 5. C /7 mark] 6. A /7 mark]
choose strong passwords I Ask for 7. Orange, Kiwi. Pear, Banana, Apple
a random selection of characters / Kiwi, Orange, Pear. Banana, Apple /7 mark for start and stop, 7 mark
Lock accounts after a number of Kiwi, Orange, Pear, Banana. Apple for input boxes, 7 mark for decision
incorrect log-in attempts /2 marks] Banana, Kiwi, Orange, Pear, Apple box with appropriate question,
Apple, Banana, Kiwi. Orange, Pear 7 mark for process boxes]
/7 mark for each row from rows 2-5]
Answers © CGP — not to be photocopied
65

Answers
Section 6: Programming
Test 20
— Pages 40-41
Test 22
1.

C [1 mark]
Pages 44-45
2. A [1 mark]
9. E.g.
function averagefa, b, c)
total = a + b + c
1. B /7 mark] 2. B /7 mark] 3. B [1 mark] 4. A [1 mark]
5. C /7 mark] 6. B [I mark] ans = total DIV 3
3. B /7 mark] 4. B /7 mark]
7. = assigns a value to a variable return ans
5. C /7 mark] 6. C /7 mark]
/7 mark], whereas == compares endfunction
7. Casting converts one data type to
a different data type /7 mark]. values/variables and returns / 1 mark for defining a function
true if they match /7 mark]. with three parameters, 7 mark for
8. 0 1 nurns = open("output,txt") finding the average, 7 mark for
03 for n = 7 to 7 9 step 2 8. A postcode contains numbers
and letters, which can be returning the whole number part]
05 nums.writeLine(sqNum)
stored as a string /7 mark].
07 nums.closeQ
9. E.g. Section 7: Design,
/7 mark for each correct line] userSelect = input("Input letter")
9. scoresArch [2,4] = 7 [1 mark] Testing and IDEs
E.g.
function totalScore(scores, arch)
switch userSelect:
case "A
listUsersf)
Test 24
1.

B /7 mark]
Pages 48-49
2. A /7 mark]
total = 0 case "B": 3. B /7 mark] 4. C /7 mark]
for i = 0 to 2 createUserQ 5. B /7 mark] 6. A /7 mark]
total = total + scores[i, arch] case "C": 7. B /7 mark] 8. C [I mark]
next i deleteUserO 9. When a compiler/interpreter is able
return total default: to run a program, but it doesn’t
endfunction print("Unrecognised selection") behave as expected /7 mark].
/7 mark for defining a endswitch 10. E.g. Breakpoints can be used to stop
function with two parameters, /7 mark for a user input, 7 mark the program at specific points to
7 mark for calculating total, for correct use of SWITCH, 7 mark allow a programmer to check things
7 mark for returning total] for correct procedures, I mark for like the values of variables /7 mark].
Test 21
1.

C [1 mark]
Pages 42-43
2. A [1 mark]
printing message for “default” case]
He will get an error saying the
n
4
4
i
1
2
triangle
1
3
3. B /7 mark] 4. B [1 mark] variable is not defined /7 mark]
5. C /7 mark] 6. A [1 mark] because local variables can’t be used 4 3 6
7. A /7 mark] 8. A /7 mark] outside of the procedure /7 mark]. 4 4 10
9. 2 /7 mark]
"Mr. JONES" [1 mark]
E.g.
Test 23
1.

Pages 46-47
B [1 mark] 2. A [1 mark]
/7 mark for each correct column]
1 2. E.g. to make it easy to read and
modify [1 mark]. It also allows
3. [1 mark] 4. C [1 mark]
x = random(0, 3) 5. A [1 mark] 6. B [1 mark] other programmers to understand
print(firstName.subStringfx, 1)) what your program does [1 mark].
/7 mark for generating a random
integer, 1 mark for correctly
printing a random character]
AANDB
0
0
0
NOTC
1
0
1
X
I
0
1
Test 25

1. A [1 mark]
Pages 50-51
2. B /7 mark]
3. B [1 mark] 4. C /7 mark]
10. E.g. An IF-ELSEIF statement can 0 0 0
5. A /7 mark] 6. A /7 mark]
check multiple conditions at once, 0 1 1
7. C H mark] 8. B [1 mark]
whereas a SWITCH statement can 0 0 0
9. E.g. Check it has an @ symbol
only check one variable [1 mark]. 1 1 1
1 0 1
and a .com or .co.uk /7 mark]. /
1 1. SELECT flightNuniber, dest Airport Check it has fewer than a certain
FROM flightPaths WHERE [I mark for each correct column] number of characters /7 mark].
depAirport = "Liverpool" [1 mark] 8. 03 pets [i] = pets[i].upper 10. Any two from: e.g. Add comments
SELECT depAirport, depTime 05 until i == 5 to explain what the IF-ELSEIF
FROM flightPaths WHERE [1 mark for each correct line] statements do. I Use indentation
flightNumber = "Fl 42" /7 mark] As i would not increase, the DO inside the IF-ELSEIF statements.
UNTIL loop would run indefinitely / Use the variable name “mark”
[1 mark] and would only change instead of “number” for clarity.
“rex” to upper case [1 mark]. /2 marks]
© CGP — not to be photocopied Answers
66

Answers
First row
Type: Normal
num
10
i num MOD i count
0
Test 29
1.
— Pages 58-59
B /7 mark] 2. N [I mark]
Reason: To ensure the program 10 1 0 1 3. B /7 mark] 4. A /7 mark]
can handle a correct input. 10 2 0 2 5. A /7 mark] 6. A /7 mark]
Second row 10 3 1 2 7. Box A: e.g. find recipes in database
Type: Invalid Box B: e.g. display recipes/costs
Outcome: “You have failed” [1 mark for each correct row]
/7 mark for each appropriate task]
Third row The function returns the number Decomposition [1 mark].
Reason: To ensure the program of factors of num /7 mark]. 8. E.g.
can handle the largest input value. 8. Merge and order sub-lists until there array data [5]
Outcome: “You have is one list: i=0
achieved a grade A” CZ AG BL FT [I mark] values = open("mass.txt")
]l mark for each correct row] ACGZ BFLT [I mark] while NOT values.endOfFilef)
ABCFGLTZ /7 mark] data[i] = values.readLineQ
Mixed Tests for Paper 2 9. Any two benefits: e.g. Easier for i=i+7
Test 26
1.

A [1 mark]
Pages 52-53
2. B [1 mark]
programmers to read and understand.
/ A single instruction of high-level
code can represent many low-level
endwhile
values.closeQ
/7 mark for creating an array,
3. C /7 mark] 4. B /7 mark] instructions. I A programmer does
5. B /1 mark] 6. A /7 mark] 7 mark for opening the file, 7 mark
not need to have knowledge about
7. C [1 mark] 8. B /7 mark] for a correct WHILE loop, 1 mark
the internal structure of the CPU to
9. A = = mark] for use of endOfFilef) to end the
write high-level code. / High-level WHILE loop, I mark for assigning
R = A AND (NOT B) ]1 mark] code can work on multiple machines
10. E.g. values to the array using readLineQ,
with different processors. /2 marks]
Test 28
1.

A [1 mark]
Pages 56-57
2. B /7 mark]
1.
I mark for closing the file at the end]
Test 30
— Pages 60-61
B /7 mark] 2. C /7 mark]
3. A /7 mark] 4. A /7 mark]
3. A /7 mark] 4. A /7 mark]
5. B /7 mark] 6. A /7 mark/
5. B /7 mark] 6. C /7 mark]
7. B /7 mark] 8. C [I mark]
7. B /7 mark] 8. B /7 mark]
9. Replace line 03 with the code
9. AANDB NOT (A AND B)
roll = randomfl, 20) [1 mark].
Put the code on line 05 inside the False True
loop, after line 03 /7 mark]. False True
1 0. E.g. A code editor can have auto¬ False True
colour coding, auto-indent etc.
True False
to help readability. / A run-time
11 mark for correct inputs, 7 mark environment can quickly run code /7 mark for each column]
for decision with branches labelled, within an IDE and show where any 10. Line 04: switch type should
7 mark for correct outputs] errors take place. /2 marks] be switch code [1 mark].
11. If a variable is global then you need 11. E.g. Line 10: there is a missing
to be careful that you don’t change function rollingSales(num) closed bracket [1 mark].
it or use the same name somewhere total = 0 There is no line of code to end the
else in the program /7 mark]. for i = 7 to num SWITCH statement [1 mark].
Local variables can only be total = total + sales [i -I] 1 1 . The function represents a binary
used inside a sub program, so next i search [1 mark], e.g. because
developers can use them without return total line 5 identifies the middle item
risk of changing other parts of endfunction of the list/array [1 mark].
the main program /7 mark]. /7 mark for correctly using the
Test 27

Pages 54-55 num parameter, 1 mark for
using an appropriate loop to

COXP42
1. C [1 mark] 2. A [1 mark]
3. B /7 mark] 4. B [1 mark] calculate total sales, 7 mark
5. C /7 mark] 6. A /7 mark] for returning total sales]

Answers © CGP — not to be photocopied


O IQ w P)

a
of
System Test 1

Isues
0

F* »— I—«

Test 20

Compnets Computer Test 2

Test 3
1
0 cnF*

0w
h— bo
'

«
1— w Progamin Test 21

Test 22

Paper
Reprsntaio
Test 4 i-30 cn <-► Test 23

for
Dat Test 5
Test
H30cn »— cn
*

Design,TestingIaDnEds
Test 24

Mixed
«

Test 6 •-30cn t— CD Test 25

Test 7 0 w F* KI Test 26
2

Paper
Networks
Test 8

Test 9
Algorithms 0l/l f*

i-30 tn I—* CD
co

for
Test
Test 27

Test 28

Test 10
Mixed Test 29

Test 30

Some blindingly obvious advice:


If a test didn't go too well, go away and revise that topic before you try the next test.
Focus your revision on the topics you're struggling with
— don't just do the stuff you find easiest!
CGP

Break GCSE Computer Science


into byte-sized chunks! jitp bi
This CGP 10-Minute Tests book is the ultimate hack for Computer Science...
scien
• Quickfire tests covering every OCR topic...
Perfect for checking how much you know
(Ora e
d-i)
• Tailor-made for the new 2022 exams...
You bet — we’re the revision experts!

• Answers to all questions included...


Plus a handy chart to track your progress

P.S. Need more help? Don’t miss CGP’s fantastic


Revision Guide, Exam Practice Workbook
and Revision Question Cards!

t'uie-Msintce
00XP42 £4.95
(Retail Price)
www.cgpbooks.co.uk

You might also like