0% found this document useful (0 votes)
25 views90 pages

My Revision Notes Aqa Alevel Computer Science 3rd Edition 3rd Edition Mark Clarkson Instant Download

The document is a promotional and informational piece about 'My Revision Notes AQA A-level Computer Science' by Mark Clarkson, providing links to download the book and other related educational resources. It emphasizes the importance of structured revision and offers various study aids including workbooks, student guides, and magazines. Additionally, it highlights the availability of eTextbooks and online resources to support students in their exam preparation.

Uploaded by

ritvansfera
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)
25 views90 pages

My Revision Notes Aqa Alevel Computer Science 3rd Edition 3rd Edition Mark Clarkson Instant Download

The document is a promotional and informational piece about 'My Revision Notes AQA A-level Computer Science' by Mark Clarkson, providing links to download the book and other related educational resources. It emphasizes the importance of structured revision and offers various study aids including workbooks, student guides, and magazines. Additionally, it highlights the availability of eTextbooks and online resources to support students in their exam preparation.

Uploaded by

ritvansfera
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/ 90

My Revision Notes Aqa Alevel Computer Science

3rd Edition 3rd Edition Mark Clarkson download

https://ebookbell.com/product/my-revision-notes-aqa-alevel-
computer-science-3rd-edition-3rd-edition-mark-clarkson-36446100

Explore and download more ebooks at ebookbell.com


Here are some recommended products that we believe you will be
interested in. You can click the link to download.

My Revision Notes Aqa Alevel Computer Science Mark Clarkson

https://ebookbell.com/product/my-revision-notes-aqa-alevel-computer-
science-mark-clarkson-36461814

My Revision Notes Aqa A Level Law 2nd Edition Beauman Craig

https://ebookbell.com/product/my-revision-notes-aqa-a-level-law-2nd-
edition-beauman-craig-54844910

My Revision Notes Aqa Alevel Politics Us And Comparative Politics


Rowena Hammal Simon Lemieux

https://ebookbell.com/product/my-revision-notes-aqa-alevel-politics-
us-and-comparative-politics-rowena-hammal-simon-lemieux-34170390

My Revision Notes Aqa A Level Maths Applied Stella Dudzic

https://ebookbell.com/product/my-revision-notes-aqa-a-level-maths-
applied-stella-dudzic-36668422
My Revision Notes Aqa Alevel Accounting David Lewis

https://ebookbell.com/product/my-revision-notes-aqa-alevel-accounting-
david-lewis-44582460

My Revision Notes Aqa Asalevel History Revolution And Dictatorship


Russia 19171953 Robin Bunce Neil Owen

https://ebookbell.com/product/my-revision-notes-aqa-asalevel-history-
revolution-and-dictatorship-russia-19171953-robin-bunce-neil-
owen-49930240

My Revision Notes Aqa Asalevel History The Making Of A Superpower Usa


18651975 Peter Clements

https://ebookbell.com/product/my-revision-notes-aqa-asalevel-history-
the-making-of-a-superpower-usa-18651975-peter-clements-44587064

My Revision Notes Aqa Gcse 91 Business Malcolm Surridge

https://ebookbell.com/product/my-revision-notes-aqa-gcse-91-business-
malcolm-surridge-54844930

My Revision Notes Aqa As Chemistry Uk Ed Rob King

https://ebookbell.com/product/my-revision-notes-aqa-as-chemistry-uk-
ed-rob-king-11275366
Looking to boost your learning?
Ensure you’re on track to excel in your studies with trusted
A-level study and revision resources from Hodder Education.

My Revision Student Guides


Notes Consolidate knowledge and
strengthen exam technique with
There are hundreds of My Revision
our convenient and content-
Notes across a wide range of
packed range of Student Guides.
subjects. My Revision Notes
Benefit from clear topic-by-
will set you on track to achieve
topic course coverage alongside
your best with structured topic
challenging sample questions and
summaries to test your knowledge
answers that will keep you on
and understanding of key content,
track for success.
accompanied by a mixture
of activities and exam-style
questions that will help you to
perfect your written answers.

Also available as eTextbooks Also available as eTextbooks


www.hoddereducation.co.uk/mrn www.hoddereducation.co.uk/studentguides

Student Magazines
Workbooks Ideal for developing independent
learning skills, our Student
Maximise your potential with
Magazines provide in-depth
these write-in workbooks written
information surrounding subject
by experienced authors to help
content, with topical articles
you to practise and apply what
and expert exam advice to help
you have learned during your
deepen your understanding and
course. Build confidence and
put knowledge into context.
independent learning skills
through a blend of focused course
guidance and varied practical
activities.

Answers to workbook
questions available online
at hodderplus.co.uk Also available as eMagazines
www.hoddereducation.co.uk/studentworkbooks www.hoddereducation.co.uk/magazines

For more information about all our revision titles


and series across a wide range of subjects, visit:
www.hoddereducation.co.uk/revision

IFC catalogue ads.indd 1 29/10/2020 14:40


325487_01_MRN_AQA_CS_001-033.indd Page 1 6/29/21 9:39 PM f-0116 /103/HO02206/work/indd

AQA
A-level

COMPUTER
SCIENCE
THIRD EDITION

Mark Clarkson
325487_01_MRN_AQA_CS_001-033.indd Page 2 6/29/21 9:39 PM f-0116 /103/HO02206/work/indd

Every effort has been made to trace all copyright holders, but if any have been inadvertently
overlooked, the Publishers will be pleased to make the necessary arrangements at the first
opportunity.
Although every effort has been made to ensure that website addresses are correct at time of
going to press, Hodder Education cannot be held responsible for the content of any website
mentioned in this book. It is sometimes possible to find a relocated web page by typing in
the address of the home page for a website in the URL window of your browser.
Hachette UK’s policy is to use papers that are natural, renewable and recyclable products
and made from wood grown in well-managed forests and other controlled sources. The
logging and manufacturing processes are expected to conform to the environmental
regulations of the country of origin.
Orders: please contact Hachette UK Distribution, Hely Hutchinson Centre, Milton Road,
Didcot, Oxfordshire, OX11 7HH. Telephone: +44 (0)1235 827827.
Email [email protected]. Lines are open from 9 a.m. to 5 p.m., Monday to Friday.
You can also order through our website: www.hoddereducation.co.uk
ISBN: 978 1 3983 2548 7
© Mark Clarkson 2021
First edition published in 2016. This edition published in 2021 by
Hodder Education,
An Hachette UK Company
Carmelite House
50 Victoria Embankment
London EC4Y 0DZ
www.hoddereducation.co.uk
Impression number 10 9 8 7 6 5 4 3 2 1
Year 2025 2024 2023 2022 2021
All rights reserved. Apart from any use permitted under UK copyright law, no part of this
publication may be reproduced or transmitted in any form or by any means, electronic
or mechanical, including photocopying and recording, or held within any information
storage and retrieval system, without permission in writing from the publisher or under
licence from the Copyright Licensing Agency Limited. Further details of such licences (for
reprographic reproduction) may be obtained from the Copyright Licensing Agency Limited,
www.cla.co.uk
Cover photo © Maksym Yemelyanov - stock.adobe.com
Illustrations by Aptara, Inc.
Typeset in India by Aptara, Inc.
Printed in Spain
A catalogue record for this title is available from the British Library.
325487_01_MRN_AQA_CS_001-033.indd Page 3 6/29/21 9:40 PM f-0116 /103/HO02206/work/indd

Get the most from this book

Get the most from this book


Everyone has to decide his or her own revision You can also keep track of your revision by ticking
strategy, but it is essential to review your work, off each topic heading in the book. You may find
learn it and test your understanding. These Revision it helpful to add your own notes as you work
Notes will help you to do that in a planned way, through each topic.
325487_01_MRN_AQA_CS_001-033.indd Page 5 6/12/21 7:38 PM f-0236-new /103/HO02206/work/indd

topic by topic. Use this book as the cornerstone My Revision Planner 7 Computer organisation and architecture
158 Internal hardware components
162 The stored program concept

of your revision and don’t hesitate to write in it —

My Revision Planner

My Revision Planner
162 Structure and role of the processor and its components
Introduction 173 External hardware devices
6 Command words
8 Consequences of using computers
1 Fundamentals of programming 182 Moral, ethical, legal and cultural issues and opportunities
9 Programming
9 Fundamentals of communication and networking

personalise your notes and check your progress by


22 Programming paradigms
188 Communication
23 Object-oriented programming
190 Networking
2 Fundamentals of data structures 195 The internet
34 Data structures and abstract data types 201 The Transmission Control Protocol/Internet Protocol
39 Queues 10 Fundamentals of databases

ticking off each section as you revise.


41 Stacks 214 Conceptual models and entity relationship modelling
43 Graphs 216 Relational databases
45 Trees 217 Database design and normalisation techniques
47 Hash tables 222 Client-server databases
48 Dictionaries 11 Big Data
48 Vectors 224 Big data
3 Fundamentals of algorithms 12 Functional programming
53 Graph traversal 227 Functional programming paradigm
57 Tree traversal 230 Writing functional programs
60 Reverse Polish notation 13 Systematic approach to problem solving

Tick to track your progress


62 Searching algorithms 235 Aspects of software development
65 Sorting algorithms
241 Now test yourself answers
67 Optimisation algorithms
4 Theory of computation 253 Exam practice answers
71 Abstraction and automation
83 Regular languages
89 Context-free languages
91 Classification of algorithms
96 A model of computation

Use the revision planner on pages 4–7 to plan your


5 Fundamentals of data representation
103 Number systems
104 Number bases
108 Units of information
109 Binary number system

revision, topic by topic. Tick each box when you


121 Information coding systems
125 Representing images, sound and other data
6 Fundamentals of computer systems
139 Hardware and software
141 Classification of programming languages

have:
143 Types of program translator
145 Logic gates
152 Boolean algebra

4 5

✚ revised and understood a topic Check your understanding and progress at www.hoddereducation.co.uk/myrevisionnotesdownloads

325487_02_MRN_AQA_CS_034-052.indd Page 34-35 6/12/21 7:35 PM f-0236-new


My Revision Notes AQA A-level Computer Science Third Edition

/103/HO02206/work/indd

✚ tested yourself 2 Fundamentals of data structures


This code will step through the items in the array n times, where n is the size
of the array. This code would work for all arrays regardless of their size. This
is far more efficient than stepping through several variables one at a time, as
this would require a separate line of code for each variable and the program
Making links
One-dimensional arrays
can be an effective way

✚ practised the exam questions and gone online

2 Fundamentals of data structures


would need to be edited every time the number of items changed. of representing a vector.
Vectors are used in many

Data structures and abstract Multi-dimensional arrays games and physical models,
and are discussed in more

data types
A two-dimensional array can be written down as a table. detail towards the end of
A two-dimensional array can be thought of as an array of one-dimensional this chapter.
arrays.

to check your answers and complete the quick


Data structures
By identifying which row is being addressed using one array index, a
Data structures are designed to hold several items of data at a time. This particular value can be addressed within that row using a second array index.
Data structure The
makes it easier to manage, find, update and process data than to work with Numbers [0]
concept of storing multiple
individual variables. values together with a [0] [1] [2] [3]
For instance, finding the biggest value from ten separate variables would single identifier. [0] 1 3 5 7 Numbers [0][3]

quizzes
require a separate selection statement to interrogate each one, and additional Array A data structure for
code would be needed each time the number of variables increased. Numbers [1]
holding values in a table. Numbers
Using a data structure called an array means that it is possible to step through [0] [1] [2] [3]
[0] [1] [2] [3]
each item using a loop, reducing the amount of code and making the code [1] 11 13 17 19
[0] 1 3 5 7
much more flexible . Exam tip
[1] 11 13 17 19 Numbers [2]
Arrays can also be defined
Single- and multi-dimensional arrays [2] 23 29 31 37 [0] [1] [2] [3]
using the first index to find
[3] 41 43 47 51 [2] 23 29 31 37
(or equivalent) Numbers [2][2]
the column and the second
Numbers [3]
index to find the item in that
An array is a fixed-size collection of values, all of the same data type. column. Always read the
Index A value indicating the [0] [1] [2] [3] question carefully as any
Single-dimensional arrays position of a value with in [3] 41 43 47 51 ambiguities should be made
A single-dimensional array can be written down as a single row of a table. an array or list. Numbers [3][1] clear.

Each individual item in the array is referred to using the identifier (or List A data structure similar Figure 2.1 A two-dimensional array called Numbers
variable name) of the array, followed by the index in brackets (usually square to an array, commonly used Making links
In the example above the contents of Numbers[0][3] can be found by isolating
in Python in place of an
brackets). Each index position can hold data. row 0 and then finding the item in position 3. One common use for a
array.
two-dimensional array is
Index [0] [1] [2] [3] [4] A two-dimensional array is useful because it can store more complex data; for
storing a matrix. Matrices
example, the scores for different students or values for different days.
Data 1 3 5 7 11 Exam tip are often used in complex
It is possible to find the size of a two-dimensional array using the Length maths, and can also be used
In most languages (including
function (exact syntax varies by programming language). to represent a graph data
Note C#, Delphi/Pascal, Java &
structure. This is explored
VB.Net) the array index For an array with indexes defined as [row][column], to find the number of
Arrays are always declared as a fixed size and cannot be changed later in the program. further later in this chapter.
starts at 0, but be very rows, find the number of one-dimensional arrays the table can be split into:
In an array, all data must be of the same data type. careful when reading
NumberOfRows ← Length(ArrayName)
Lists are very similar to arrays, however it is possible to alter the size of a list while the exam questions as some
Matrix A rectangular, two-
program is running and it is possible to store data of differing types in the same list. languages and some To find the number of columns, find the length of a row in the table: dimensional collection of
scenarios will have the array
In some languages (notably including Python) it is much more common to use a list, NumberOfColumns ← Length(ArrayName[0]) values.
index starting at 1.
whereas in others it is much more common to use an array. Nested A selection
To interrogate a two-dimensional array it is necessary to use nested loops.
You are not expected or required to show your understanding of the difference statement or loop inside
FOR i ← 0 to Length(Numbers) // Step through each row another selection statement
between the two, and you should use whichever version is most suitable for your
chosen programming language. FOR j ← 0 to Length(Numbers[i]) // Step through each or loop.
value in that row
Arrays are an effective solution for storing several values because a FOR loop OUTPUT Numbers[i][j] Exam tip
can be used to iterate (or loop) over an array.
ENDFOR Make sure you are able to
In this example Numbers is the name of an array and Length(Numbers) hand trace a program such
ENDFOR as the one above to fully
returns the size of the array (the number of items is contains).
Using the principle above, it is possible to think of a three-dimensional array understand which counter
FOR i ← 0 TO Length(Numbers) variable is addressing the
as an array of two-dimensional arrays.
OUTPUT Numbers[i] row or column index of the
34 table. 35
ENDFOR

Check your understanding and progress at www.hoddereducation.co.uk/myrevisionnotesdownloads My Revision Notes AQA A-level Computer Science Third Edition

Features to help you succeed


Exam tips Exam skills
Expert tips are given throughout the book to These summaries highlight how to specific skills
help you polish your exam technique in order to identified or applicable in that chapter can be
maximise your chances in the exam. applied to your exam answers.

Now test yourself Revision activities


These short, knowledge-based questions provide These activities will help you to understand each
the first step in testing your learning. Answers are topic in an interactive way.
available online at www.hoddereducation.co.uk/
myrevisionnotesdownloads Exam practice
Practice exam questions are provided for each topic.
Definitions and key words
Use them to consolidate your revision and practise
Clear, concise definitions of essential key terms are your exam skills.
provided where they first appear.
Summaries
Key words from the specification are highlighted in
bold throughout the book. The summaries provide a quick-check bullet list for
each topic.
Making links
Online
This feature identifies specific connections between
topics and tells you how revising these will aid your Go online to check your answers to the
exam answers. exam questions and try out the extra quick
quizzes at www.hoddereducation.co.uk/
myrevisionnotesdownloads 3

My Revision Notes AQA A-level Computer Science Third Edition


325487_01_MRN_AQA_CS_001-033.indd Page 4 6/29/21 9:40 PM f-0116 /103/HO02206/work/indd

My Revision Planner
My Revision Planner

Introduction
6 Command words
1 Fundamentals of programming
9 Programming
22 Programming paradigms
23 Object-oriented programming

2 Fundamentals of data structures


34 Data structures and abstract data types
39 Queues
41 Stacks
43 Graphs
45 Trees
47 Hash tables
48 Dictionaries
48 Vectors
3 Fundamentals of algorithms
53 Graph traversal
57 Tree traversal
60 Reverse Polish notation
62 Searching algorithms
65 Sorting algorithms
67 Optimisation algorithms
4 Theory of computation
71 Abstraction and automation
83 Regular languages
89 Context-free languages
91 Classification of algorithms
96 A model of computation
5 Fundamentals of data representation
103 Number systems
104 Number bases
108 Units of information
109 Binary number system
121 Information coding systems
125 Representing images, sound and other data
6 Fundamentals of computer systems
139 Hardware and software
141 Classification of programming languages
143 Types of program translator
145 Logic gates
152 Boolean algebra

Check your understanding and progress at www.hoddereducation.co.uk/myrevisionnotesdownloads


325487_01_MRN_AQA_CS_001-033.indd Page 5 6/29/21 9:40 PM f-0116 /103/HO02206/work/indd

7 Computer organisation and architecture


158 Internal hardware components
162 The stored program concept

My Revision Planner
162 Structure and role of the processor and its components
173 External hardware devices
8 Consequences of using computers
182 Moral, ethical, legal and cultural issues and opportunities
9 Fundamentals of communication and networking
188 Communication
190 Networking
195 The internet
201 The Transmission Control Protocol/Internet Protocol
10 Fundamentals of databases
214 Conceptual models and entity relationship modelling
216 Relational databases
217 Database design and normalisation techniques
222 Client-server databases
11 Big Data
224 Big data
12 Functional programming
227 Functional programming paradigm
230 Writing functional programs
13 Systematic approach to problem solving
235 Aspects of software development

241 Glossary

My Revision Notes AQA A-level Computer Science Third Edition


325487_01_MRN_AQA_CS_001-033.indd Page 6 6/29/21 9:40 PM f-0116 /103/HO02206/work/indd

Introduction
Introduction

As a student of computer science, it is important that you understand three


things in relation to the A-level examinations.
✚ Assessment objectives
✚ Command words
✚ Exams and NEA

Assessment objectives
✚ AO1 You should be able to demonstrate knowledge and understanding of
the principles and concepts of computer science, including abstraction, logic,
algorithms and data representation.
✚ AO2 You must be able to apply your knowledge and understanding of the
principles and concepts of computer science, including to analyse problems in
computation terms.
✚ AO3 You must be able to design, program and evaluate computer systems
that solve problems, making reasoned judgements about these and presenting
conclusions.

Command words
Familiarity with the relevant command words is important. It helps you to
avoid wasting time in the exam room (for example, trying to evaluate when
there is no requirement for it). The most frequently used command words
used for the A-level papers are listed here.
✚ Calculate… requires you to work out the value of something. A correct
final answer, to the required degree of accuracy and with the correct units,
will score full marks. Working is usually required, and correct working can
score marks. (AO2)
✚ Compare… requires you to identify similarities and differences between
ideas, technologies, or approaches. (AO1)
✚ Create… requires you to write program code that solves a problem. Even if
you struggle to get the syntax correct, marks are awarded for evidence of
the approach taken as well as for working code. (AO3)
✚ Define… requires you to specify the meaning of a technical term in order
to show that you understand what it means. (AO1)
✚ Describe… requires you to set out the characteristics of a device or a
computing concept. These can be very short questions worth 1 mark, or
long-answer questions worth up to 12 marks. (AO1)
✚ Discuss… requires you to present the key points. These questions are
typically of medium length, worth 4-6 marks. You should aim to present as
many points as you can and, where appropriate, provide balance between
advantages and disadvantages. (AO1)
✚ Draw… requires you to produce a diagram. These are usually technical
diagrams such an E-R diagram for a database, or a logic circuit diagram. (AO2)
✚ Explain… requires you to provide purposes or reasons. These questions
are used to assess your knowledge of a topic and can sometimes be used
within a specific context. If a question is asked in relation to a particular
scenario then you should always make sure you link to the scenario in
your answer. (AO1, AO2)
✚ Express… requires you to convert an input into a particular format.
Examples might include encrypting a message or calculating a value. (AO2)
✚ Modify… requires you to take an existing section of program code and add
to or edit it. This is commonly asked as part of Section D in Component 1,
involving changes to the skeleton program. (AO3)
✚ State… requires you to express some knowledge in clear terms. These questions
6
are usually short answer questions and are usually worth 1 mark. (AO1)

Check your understanding and progress at www.hoddereducation.co.uk/myrevisionnotesdownloads


325487_01_MRN_AQA_CS_001-033.indd Page 7 6/29/21 9:40 PM f-0116 /103/HO02206/work/indd

✚ Suggest… requires you to present a suitable case or solution. (AO1, AO2)


✚ Test… requires that you run the code that you have written in order to
check that it functions as it should. This is usually combined with a write/
create/modify question in component 1 and screenshots of the testing

Introduction
process should be included. (AO3)
✚ Write… requires you to create a program or a Boolean expression to solve
a specific problem. These questions can be quite lengthy and partially
complete answers are usually worth a significant proportion of the marks.
(AO2, AO3)

Exams and NEA


The AQA A-level in Computer Science is assessed using three components.
There are two exams, both taken at the end of the course, and one piece
of non-examination assessment (NEA) which is based on a programming
project.
Component 1 Component 2 Component 3
On-screen exam Written exam Programming project (NEA)
2.5 hours 2.5 hours Internally assessed
40% weighting 40% weighting 20% weighting

Component 1
Component 1 is an on-screen exam, largely focused on programming
and computation. In advance of the exam, you and your teachers will
be provided with a skeleton program and a small pack of background
information.
The exam will be taken using a programming language you have studied
throughout the course, and will be pre-selected by your teacher. The available
languages are:
✚ C# ✚ Python
✚ Java ✚ VB.net
✚ Pascal/Delphi
The skeleton program is a working program that is functional but could
be improved. Typical examples include text-based role-playing games or
simulations.
For A-level students the pre-release information is available from September
of that academic year (typically Year 13).
The pre-release information should be given to you by your teacher, but they
may choose not to give the information out straight away, depending on how
and when they plan to deliver the content.
The A-level exam is split into four sections:
1 Section A: Questions about programming and computation; for example,
finite state machines, standard algorithms, trace tables, Turing machines and
computation logic.
2 Section B: A programming problem (unrelated to the skeleton program);
for example, writing a program to convert between binary and denary
numbers.
3 Section C: Questions about the skeleton program; for example, identifying
specific variables or programming constructs, hierarchy charts, class
diagrams and explaining the purpose of specific elements.
4 Section D: Improving the skeleton code; for example, adding an extra menu
option, improving exception handling, adding new functionality.

Component 1 tests programming ability as well as theoretical knowledge


covered in Chapters 1–4, and the skills covered in Chapter 13.
7

My Revision Notes AQA A-level Computer Science Third Edition


325487_01_MRN_AQA_CS_001-033.indd Page 8 6/29/21 9:40 PM f-0116 /103/HO02206/work/indd

Programming syntax
Some questions in Component 1 will include algorithms written using AQA
pseudo-code. It is important to be able to read and understand this pseudo-
code and, in some cases, to write program code in your chosen programming
Introduction

language based on the pseudo-code algorithms provided.


This book is not intended to teach you how to program using one specific
language and uses pseudo-code similar to that used by AQA. Any code that
is not labelled as being from a particular language is instead written in AQA
pseudo-code.

Component 2
Component 2 is a traditional-style written paper, largely focused on the more
theoretical components of this course.
The topics covered in this paper test subject content from Chapters 5–12, and
typically include:
✚ data representation ✚ networking
✚ computer systems ✚ databases and Big Data
✚ computer hardware ✚ functional programming.
✚ consequences of computing
As this is a written paper, no practical programming activities are assessed,
though some practical elements such as calculations, data conversions and
trace tables (especially for assembly language and instruction sets) are likely
to appear.
This paper will generally include short answer questions (1–2 marks) that will
assess your knowledge, questions that will assess your ability to apply your
knowledge (3–4 marks), and a small number of longer-answer questions that
require detailed discussion (6–12 marks).
For these longer-answer discussion questions, credit is awarded for
identifying, discussing and evaluating potential issues.
✚ Marks are awarded for identifying relevant knowledge; for example,
suggesting appropriate input devices for collecting data or identifying the
methods by which wireless data transmissions can be intercepted.
✚ To reach the top mark bands it is important to follow a line of reasoning, using
your knowledge to write in connected sentences in a way that makes sense
and relates to the context of the question. Explaining how each point links to
the scenario and adding as much technical detail and vocabulary as you can
makes it more likely that you will score well on this type of question.
✚ Always make sure you back up any arguments or suggestions you make
with facts, logical arguments and technical details, as unsubstantiated
statements don’t demonstrate your understanding.

Component 3
Component 3 is a non-examination assessment (NEA) component, based on
completing a programming project.
The programming project is extremely open-ended, and it is up to you to
identify a real-world problem and then work through each phase of the
systems development lifecycle in order to solve it.
It is beyond the scope of this book to go into detail in terms of completing
the programming project, but typical examples include online booking and
scheduling systems, computer games with a simple AI component, animal
population simulations, and so on. There is no definitive list of expected or
excluded projects and your teacher will be able to provide with much more
specific guidance.

Check your understanding and progress at www.hoddereducation.co.uk/myrevisionnotesdownloads


325487_01_MRN_AQA_CS_001-033.indd Page 9 6/29/21 9:40 PM f-0116 /103/HO02206/work/indd

1 Fundamentals of programming

Programming
Data types
It is important to declare variables using the correct data type. This will make
sure that memory is not wasted, and that the program is able to process the
data correctly.
Different data types are processed in different ways; for example, adding two
strings produces a different result to adding two integers.
"123" + "456" = "123456"

123 + 456 = 579


The main data types are:
Data type Suitable for Examples
integer whole numbers 7, 9, 163
real/float fractional numbers 7.3, 9.6, 0.5
Boolean True/False True, False
character a single letter or other character 'b', 'W', '@'
string text "word", "EC4Y 0DZ"
date/time a date, time, or combination 14:18, 17/10/2004
pointer a memory address #bf4e3a67
record a collection of fields RECORD username, password
array a table of data [1,3,5,7,11,13,17]

Different data types use different amounts of memory. If a numeric variable


will always hold a whole number, it will use less memory stored as an integer
than it will if stored as a real or float.

Note
All programming languages deal with data types slightly differently.
It is important to note that Python does not support the character data type, using
only a string to store text of any length. Python also does not support the array data
type. The closest alternative is a list data type.

Most of the data types are quite straightforward. Exam tip


✚ Records are more complex as they allow the programmer to group
There are many additional
together attributes of different types; for example, a user record may have
data types, some quite
attributes for Username, Password and Last_Login. specific (for example, for
✚ An array is a table-like structure. Each field in an array must be of the whole numbers Java has a
same data type (e.g. an array of integers, or an array of strings). choice of byte, short, int or
long). The mark schemes
Making links
allow for any appropriate
Arrays are an important data structure that are used to store sets of data together. answer though only those
The use of arrays can increase the efficiency of programs when processing lots of listed above are strictly
data. Arrays are covered in detail in the chapter on data structures. required.

My Revision Notes AQA A-level Computer Science Third Edition


325487_01_MRN_AQA_CS_001-033.indd Page 10 6/29/21 9:40 PM f-0116 /103/HO02206/work/indd

Built-in and user-defined data types Exam tip


Built-in data types are those already defined by a programming language.
User-defined data types are
The exact list varies from language to language, but most of those in the table
mostly like to appear in the
above are built-in to most programming languages.
1 Fundamentals of programming

skeleton code. Look for any


It is possible for a user to define their own data types, combining more data types made up of other
than one value per variable. The use of user-defined data types means that variables in the skeleton
program code can be simplified, with attributes being grouped together. This code and make sure
can be carried out in various ways in different languages. A good example that you are comfortable
might be a user data type that is made up of a username and a password. working with them in the
syntax used in your chosen
Now test yourself language.

1 What data type is most suitable for storing a whole number?


2 What is the difference between a character and a string?
3 What sort of data would be stored in a pointer?
4 Suggest two fields that could be included in a user-defined record for recording
high scores on a game.

Answers available online

Programming concepts
For each of the programming concepts you should be familiar with both the
Pseudo-code A format
pseudo-code used by AQA and the syntax used in your own programming
for program code that
language.
is not specific to one
programming language.
Declaration Used extensively in
Variable declaration is the process of creating a variable. Component 1. Pseudo-code
is useful for describing an
In languages which are strongly typed (for example, C#, Pascal/Delphi, Java algorithm that could be
and VB.net) the data type of the variable is stated, followed by the variable’s coded in one of several
identifier. In these languages it is possible to declare a variable without different languages.
initially assigning a value to it.
Syntax The strict rules
✚ int Age; (C# and Java)
and structures used within
✚ var Age: integer; (Delphi and Pascal)
a specific programming
✚ Dim Age As Integer (VB.net)
language. You will only be
In languages which are weakly typed (for example, Python) a value must be assessed in the syntax of
assigned to a new variable, and no data type is declared as the data type can one programming language
be changed during the course of the program. for Component 1.
✚ Age = 18 (Python) Declaration The creation
Constants are declared in a similar way, but with a key word that indicates of a variable in memory.
the variable cannot be changed. Because the value of a constant cannot be
changed later, they must be declared with an initial value:
Exam tip
✚ const int MAX = 3; (C#)
✚ Const MAX = 3; (Pascal/Delphi) In Component 1 you will
✚ final int MIN = 3; (Java) be presented with pseudo-
✚ Const MAX As Integer = 3 (VB.net) code algorithms to read,
and to turn into program
Python does not support the use of constants and therefore it is not possible code, but you will not be
to prevent the accidental assignment of a new value to a constant. expected to write answers
using pseudo-code.
Making links
Practical programming
It is important to consider where a variable is declared. A variable declared inside an questions are intended to
IF statement, loop or subroutine can only be used within that section of the code be coded using the specific
and will be destroyed once that section has ended. This issue is dealt with more in the programming language you
section on local and global variables. have been entered for.

10

Check your understanding and progress at www.hoddereducation.co.uk/myrevisionnotesdownloads


325487_01_MRN_AQA_CS_001-033.indd Page 11 6/29/21 9:40 PM f-0116 /103/HO02206/work/indd

Assignment Assignment Changing the


Changing the value of a variable is called assignment. value of a variable stored in
✚ Assignment in AQA pseudo-code often uses a left arrow (for example, memory.
Score ← 12).

1 Fundamentals of programming
✚ Assignment in most programming languages uses an equals sign (for
example, Score = 12)

Now test yourself

5 What is meant by the term declaration?


6 Describe one difference between the declaration of a variable and the declaration
of a constant.
7 What symbol is used to indicate assignment in AQA pseudo-code?
8 What symbol is used to indicate assignment in most programming languages?

Answers available online

Sequencing
Program code is executed in the order in which it appears. For example, given
the code:
x ← 5
OUTPUT x
x ← x + 1
The value 5 will be output before the value of x is increased.

Selection Selection A program


All but the simplest computer programs need to include decisions. A simple structure that makes a
decision of whether to execute a particular block of code is controlled by a decision about which block
selection statement, often implemented using an IF statement. of code to execute, typically
implemented using an IF
IF score > 90 THEN statement.
OUTPUT "Top marks!" SWITCH An alternative
ELSE IF score > 60 THEN selection structure to an IF
statement that is slightly
OUTPUT "Good job." quicker to execute if used
ELSE with exact values rather
than a range.
OUTPUT "Try again."
END IF
Exam tips
There are no limits to how many ELSE IF statements can be used, but with
a large number it is possible to use a SWITCH statement instead. A SWITCH Remember that IF and
statement is slightly faster to execute if used with single values (rather than ELSE IF commands need
checking for a range) a conditional statement
with a Boolean (True/
SWITCH (grade) False) answer. The ELSE
CASE "A*" THEN command doesn’t as it will
catch all other possibilities.
OUTPUT "Top marks!"
You are not required to
BREAK use a SWITCH statement
and can score full marks
CASE "A" THEN
using IF-ELSE IF-
OUTPUT "Very good job." ELSE. The skeleton code or
pseudo-code may include a
BREAK
SWITCH statement so you
… should make sure you are
familiar with the concept. 11
END SWITCH

My Revision Notes AQA A-level Computer Science Third Edition


325487_01_MRN_AQA_CS_001-033.indd Page 12 6/29/21 9:40 PM f-0116 /103/HO02206/work/indd

Nested selection
Nested IF statements occur when an IF statement is placed inside an IF
Nested Placing a
statement.
programming structure
IF animal = "dog" THEN inside another programming
1 Fundamentals of programming

structure.
IF target = "sheep" THEN
OUTPUT "Dog chases sheep"
Revision activity
ELSE
✚ Write a program in your
OUTPUT "Dog wags tail"
chosen programming
END IF language that uses an
IF statement to allow
END IF the user to choose one
of four options.
Now test yourself
✚ Re-write the program
9 What programming concept is implemented using an IF statement? to use a SWITCH
10 Which part of an IF statement does not need a condition? statement.
11 What alternative to an IF statement is sometimes used if there are several
possible options? Exam tips
12 What is meant by a nested IF statement?
Be very careful with the
Answers available online start and end conditions
when creating FOR loops.
While a pseudo-code
Iteration algorithm may explicitly
When a block of code needs to be repeated, this is referred to as iteration. start and end at given
values, the implementation
Definite iteration for a FOR loop may be
Definite iteration, or count-controlled iteration, refers to the use a FOR loop, less clear (for example,
where the number of times to repeat is known. Even if the number of times to in Python for i in
repeat isn’t always the same, if it is known at the start of the loop then a FOR range(1,5) would stop
loop should be used. at i = 4 and in Java for
(int i = 1; i < 5;
You should be familiar with the syntax of a FOR loop in your own i++) would also stop at
programming language as well as the pseudo-code you might see in an exam: i = 4).
FOR i ← 1 TO 5 Although the specification
refers to definite and
OUTPUT "This is step " + i
indefinite iteration, question
ENDFOR papers typically use the
terms count-controlled and
Indefinite iteration condition-controlled iteration.
Indefinite iteration or condition-controlled iteration refers to a loop where
the number of iterations is not known. A typical example might be a
Iteration The repetition of
validation loop, asking a user to enter a valid input and repeating while a process or block of code.
their answer is invalid.
Definite iteration,
Indefinite loops can be further split into those that assess the condition at the or count-controlled
start of the loop (a WHILE loop) and those that assess the condition at the end iteration Iterating a fixed
of the loop (a DO-WHILE loop). number of times (also
In AQA pseudo-code: known as a count-controlled
loop, implemented as a
A WHILE loop will have the condition at the top of the loop, allowing the program to FOR loop).
bypass the code inside completely. For example: Indefinite iteration, or
value ← 5 condition-controlled
iteration Iterating until a
WHILE value < 100 DO
condition is met (also known
value ← value * 2 as a condition-controlled
ENDWHILE loop, implemented in AQA
pseudo-code as a WHILE
12 loop or DO-WHILE loop).

Check your understanding and progress at www.hoddereducation.co.uk/myrevisionnotesdownloads


325487_01_MRN_AQA_CS_001-033.indd Page 13 6/29/21 9:40 PM f-0116 /103/HO02206/work/indd

A DO-WHILE loop will have the condition at the bottom of the loop, forcing the program Note
to pass through the code at least once. For example:
Python does not support
DO
the use of a DO-WHILE

1 Fundamentals of programming
OUTPUT "Enter shoe size:" loop, but students are still
expected to be familiar with
ShoeSize ← INPUT
the concept. One solution
WHILE ShoeSize > 12 to this problem is to copy
and paste the first iteration
of the code before a WHILE
Nested iteration loop. Another is to create
Nested iteration means having a loop within a loop. This is used in a number
a REPEAT … UNTIL
of applications, including when working with 2D arrays, and in a number of structure.
standard algorithms including the bubble sort.
FOR i ← 1 TO 3
FOR j ← 1 TO 5 Remember
OUTPUT "Outer loop = " + i + " | Inner loop = " + j Remember that if you know
how many times to loop you
ENDFOR
should use a FOR loop. If
ENDFOR you don’t know how many
times then use a WHILE or
Now test yourself DO-WHILE loop.
13 What type of loop is also called a count-controlled loop? Remember that the inner
loop is completed multiple
14 When should you use a condition-controlled loop?
times for each step around
15 Describe the difference between a WHILE loop and a DO-WHILE loop. the outer loop. Selection
16 Suggest two possible uses for nested iteration. and iteration statements
can be nested inside each
Answers available online other, potentially many
layers deep.
Revision activity

✚ Write a program that uses iteration to print out the 12 times table.
Debug The process of
✚ Write a program that uses nested iteration to print out all of the times tables from 1
identifying and removing
to 12.
errors from program code.
Self-documenting
Meaningful identifier names code Program code that
It is important to choose identifiers for variables (and subroutines) that tell other uses naming conventions
programmers something about the purpose of that variable (or subroutine). and programming
✚ Var1, Var2 and Var3 are very poor choices as they make it very hard to conventions that help other
read the code and to debug if there are any errors. programmers to understand
✚ UserName, UserAge and DateUserLastLoggedIn are much more the code without needing
meaningful and are key to writing self-documenting code. to read additional
documentation.
It is not usually possible to use spaces in identifier names. Common strategies
to aid readability include the use of CamelCase, Kebab-Case or Snake_Case.
Now test yourself
Exam tip
17 Describe two
In Component 1, Section B and Section D, it is very important to use any identifier
advantages of using
names exactly as they are provided in the question. If the identifier name is not given
meaningful identifier
explicitly then remember that making it easier for the examiner to understand the
names.
code makes it more likely you will pick up the marks.
18 Explain the term self-
documenting code.
Note
Answers available
The use of meaningful identifier names to produce self-documenting code can have a online
significant impact on the marks available in the NEA.
13

My Revision Notes AQA A-level Computer Science Third Edition


325487_01_MRN_AQA_CS_001-033.indd Page 14 6/29/21 9:40 PM f-0116 /103/HO02206/work/indd

Subroutines
Information on subroutines can be found in the section Purpose of subroutines.

Arithmetic operations
1 Fundamentals of programming

There are several key operators you should make sure you are familiar with.
Simple arithmetic operators include those for addition (+), subtraction (-), Exam tip
multiplication (*) and division (/).
DIV and MOD are common
It is important to understand the different types of division operation that can
terms for integer division
be carried out: and modulo. Make sure you
✚ Real or float division will result in a real or float answer; for example, are comfortable with how
5 / 2 = 2.5 they function.
✚ Integer division will strip any fractional part of the answer, effectively
rounding down; for example, 5 DIV 2 = 2
✚ The modulo operator will find the modulus – the remainder of an integer Operators Symbols used
division, as a whole number; for example, 5 MOD 2 = 1 to indicate a function.

DIV and MOD are useful for converting between different number systems, Modulus The remainder of
the division of one number
including conversion between units of time, imperial measurements, and
by another.
between numbers using different bases (for example, denary and hexadecimal).
Exponentiation The
Exponentiation refers to powers; for example, 2^3 = 2*2*2 = 8
raising of one number to the
Rounding can be carried to a given number of decimal places or significant power of another.
figures, generally using a function; for example, round(3.14,1) = 3.1,
Rounding Reducing the
round(3.16,1) = 3.2 number of digits used to
Additional functions can be used that always round up or always round down; represent a value while
for example, roundup(3.142,1) = 3.2 maintaining its approximate
value.
Rounding down has the same effect as truncation.
Truncation Removing any
Exam tip value after a certain number
of decimal places.
Some questions in Component 1 will assess your understanding of programming
principles in general and may involve having to read and show understanding of
pseudo-code. Other questions will require you to write your own program code in your
chosen programming language, so it is important to make sure you are familiar with
the specific operators and functions that are used in that programming language.

Now test yourself Revision activity

19 What is the difference between float division and integer division? Write a program that uses
DIV and MOD to convert a
20 What is the value of 7.86 when rounded to one decimal place?
given number of hours into
21 What is the value of 7.86 when truncated to one decimal place? a number of days.
Answers available online

Relational operations
Relational operators are used in comparisons, typically in selection
statements and condition-controlled loops. A relational operation, or
comparison operation, will always return either True or False.
The relational operators are as follows:
= or == Equal to
!= or <> or ≠ Not equal to
> Greater than
>= Greater than or equal to
< Less than
14 <= Less than or equal to

Check your understanding and progress at www.hoddereducation.co.uk/myrevisionnotesdownloads


325487_01_MRN_AQA_CS_001-033.indd Page 15 6/29/21 9:40 PM f-0116 /103/HO02206/work/indd

Note
Different programming languages have different syntax rules for the equal to
comparison operator.

1 Fundamentals of programming
AQA pseudo-code and VB.net use a single equals (=).
C#, Pascal/Delphi, Java and Python use a double equals (==).

Now test yourself Making links

State whether each of these is True or False when x ← 60. C# and Java are not able to
22 x != 60 make use of the standard
relational operators when
23 x < 60
comparing strings. String
24 x >= 60 handling operations are
25 x = 60 discussed on page 16.

Answers available online

Boolean operations
Boolean operations can be used to invert the logic of a conditional statement,
or to combine two or more conditions together.
NOT Will invert the logic (that is, a condition that returns True will become False).
AND Both conditions must be True.
OR Either one condition must be True, or both.
XOR One condition must be True and the other False.

Making links
The exam for Component 2 assesses understanding of Boolean logic in much more
detail, including questions on Boolean algebra. The same basic principles apply
whether combining logical statements in a practical programming setting or solving
Boolean equations. For a more in-depth examination of Boolean logic see Chapter 6.

Now test yourself Revision activity

Where a = 50 and b = 100, would each overall condition be True or False? Write a program to calculate
the output of simple logic
26 NOT (a = b)
circuits for NOT, AND, OR
27 a < 100 AND b > 100 and XOR.
28 a > b OR b = 2*a
29 a < b XOR b = 100

Answers available online

Variables and constants


Concept of a variable
Computer programs are essentially sequences of instructions for how to Memory The location
process data. This data must be stored in memory in order to be accessed and where instructions and data
the computer program will save and retrieve data as needed. are stored in a computer.
Variables are made up of four components: Identifier A technical term
✚ A memory address – the location of the variable in memory. for the name of a variable.
✚ An identifier – a name used to identify the variable in the program code.
Data type A definition of
✚ A data type – a definition of what type of data can be stored in that
what type of data can be
variable.
stored in that variable. 15
✚ A value – the actual value of the variable at that moment in time.

My Revision Notes AQA A-level Computer Science Third Edition


325487_01_MRN_AQA_CS_001-033.indd Page 16 6/29/21 9:40 PM f-0116 /103/HO02206/work/indd

Variables are used to store values that are used in a computer program. The
Exam tip
value of a variable can be changed while the program is running (such as a
score, a running total, a user’s name). Component 1, Section C will
often start with asking you
A named constant is a variable whose value cannot be changed while the
1 Fundamentals of programming

to ‘state the identifier for…’


program is running. Examples might include constants used in calculations
some variable or subroutine
(such as Pi) or user-defined values that should be used throughout the
in the skeleton code.
program (such as a maximum number of turns or a maximum size).
For those questions you
It is a common convention to use all caps in the identifier for a constant; for must only write down the
example, MAX_SIZE or MIN_VALUE and to declare constants at the start of a identifier, and not the whole
program. line of code.

Named constants are useful because:


Named constant A
✚ they make it easier to update the program if the value of the constant
variable whose value
needs to be changed
cannot be changed while
✚ it reduces the need to use absolute values (that is, it is better to use a
the program is running.
constant in the condition for a loop than a hard-coded number)
✚ it stops the value being changed accidentally
✚ it makes code more readable. Exam tip
Remembering two or
Now test yourself three standard advantages
30 What four components make up a variable? for each aspect of
programming (such as
31 What is the meaning of the term identifier for a variable?
named constants) will help
32 What is the main difference between a variable and named constant? you answer those questions
33 What are the advantages of using a named constant? quickly and accurately in the
exam.
Answers available online

String handling operations


Working with strings is an important part of programming, and it is very
important to be familiar with the specific syntax used in different languages.
Comparing strings is handled using different syntax in different languages.
✚ In AQA pseudo-code and VB.net, a single equals (=) is used to test for
equality
✚ In Pascal/Delphi and Python, a double equals (==) is used to test for equality.
✚ In C# and Java a function must be used; for example, if (StringOne.
equals(StringTwo)) (C# and Java).
There are several other string handling operations with which you should be
familiar. The exact syntax will vary significantly depending on your chosen
Concatenate Join two
programming language and it is important to make sure you are confident
(or more) strings together;
in carrying out all of these operations in that language. Some examples are
for example, ABC + DEF =
included below, in a variety of different languages, in order to demonstrate
ABCDEF.
each operation.
The key operations are as follows.
Key operator Example
Finding length of a string len(string) or string.length()
Finding a character at a given position string.charAt(3) or string[3]
Retrieving a substring string[0:6] or string.Substring(0,6)
Concatenating two or more strings stringOne + stringTwo or
concat(stringOne,stringTwo)
Finding the numeric code for a character ord('D') or (int)'D'
Finding the character from a given numeric code char(68) or chr(68)
Converting strings into different formats, and vice-versa converting a string into an integer, float or date/time format

16

Check your understanding and progress at www.hoddereducation.co.uk/myrevisionnotesdownloads


325487_01_MRN_AQA_CS_001-033.indd Page 17 6/29/21 9:40 PM f-0116 /103/HO02206/work/indd

Exam tips Substring A series of


characters taken from a
Substring methods in different languages use different parameters.
string.
✚ Python and Java require the start and end positions.

1 Fundamentals of programming
✚ C#, Delphi and VB.net require the start position and the length.
Make sure you read any pseudo-code questions that involve substrings carefully,
and make sure you are comfortable programming with substrings using the language
chosen for your exam.
Some languages treat a string as an array of characters and can use an index array to
refer to a specific character; for example, string[3]. Some languages require the
use of functions such as charAt(int).
Make sure you are familiar with all of the operations above in your own language in
advance of the Component 1 exam.

Now test yourself

34 Explain what is meant by concatenation.


35 Which string handling operation should be used to extract a person’s first name
from the string FullName?
36 State and describe two other string handling operations.

Answers available online

Revision activity

✚ Write a program that will ask for a string and display each character’s
numeric code.
✚ Write a program that will ask for a series of numeric codes and convert them
into a single string which is displayed.

Random number generation


A large number of programs rely on random number generation.
Most languages have the ability to generate a random float between 0 and 1;
for example, in Delphi:
float: Random;
Generating a random number in a specific range can then be achieved using
multiplication; for example, to find a random float between 0 and 3 using VB.net:
Rnd() * 3
Most languages have a function for finding a random integer; for example, in
Python:
random.randint(1,3)

Exam tip
In most years there is some random number generation included in the skeleton code.
If you forget the correct syntax during the exam then make sure you know where to
find a working example from the skeleton code to help you.

Revision activity
✚ Write a program that will ask for a minimum and maximum number and will
generate a float between those two values.
✚ Write a program like that one above that will generate an integer between those
two values.
17

My Revision Notes AQA A-level Computer Science Third Edition


325487_01_MRN_AQA_CS_001-033.indd Page 18 6/29/21 9:40 PM f-0116 /103/HO02206/work/indd

Exception handling
Exception handling is used to deal with situations where a program may
Exam tip
crash. The program should try to execute a block of code and then catch the
1 Fundamentals of programming

error and deal with it appropriately. Make sure you can


explain the purpose of any
Although the exact syntax may vary between languages, the basic construct
exception handling found
typically reads: in the skeleton code as this
try may be a question asked in
Section C.
{
strInput = input("Enter a number")
Making links
numInput = int(strInput)
Using exception handling
} in your NEA programming
project is a good way
catch (Exception)
to demonstrate good
{ programming techniques.
print("Error, did not recognise a number")
numInput = -1 Revision activity

} Write a program that asks


users to enter a 2-digit
Now test yourself number as a string (such as
‘12’), convert it to an integer,
37 What does the initialism RNG typically refer to? and then double it. Use
38 What runtime error might occur in a program that asks a user to enter numeric exception handling to catch
values? errors such as a non-digit
39 What programming structure should be used to deal with these types of errors? entry (such as ‘twelve’).

Answers available online

Purpose of subroutines
A fundamental aspect of improving the efficiency of program code is the use
of subroutines. Exam tip

A subroutine allows a programmer to take a section of program code that Make sure you are able
performs a specific task and move it out of line of the rest of the program. to explain the difference
between a function and a
This means that the programmer can call the subroutine in order to run that
procedure, and that you can
block of code at any point.
identify which subroutines
Subroutines are called using the subroutine’s identifier, followed by are which in the skeleton
any arguments that must be passed in parentheses; for example, code. This is a common
DisplayGreeting(name). topic in section C.

Subroutines that do not require any parameters must still be called using
parentheses; for example, DisplayDate(). Subroutine A named block
of code designed to carry
The advantages of subroutines are:
out one specific task.
✚ the subroutine can be called multiple times without needing to duplicate
Call The process of running
the code
a subroutine by stating
✚ changes to the subroutine only need to be made once its identifier, followed by
✚ it is easier to read the code any required arguments in
✚ it is easier to debug the code if there is a problem parentheses.
✚ subroutines can be re-used in other programs Pass The transfer of a
✚ the job of writing a program can be split, with each programmer tackling value, or the value of a
their own subroutines. variable, to a subroutine.

Making links
Using meaningful, self-documenting identifiers for subroutines is important to make
18 your code more readable. It is essential to do this as part of your NEA.

Check your understanding and progress at www.hoddereducation.co.uk/myrevisionnotesdownloads


325487_01_MRN_AQA_CS_001-033.indd Page 19 6/29/21 9:40 PM f-0116 /103/HO02206/work/indd

Subroutines are broken down into two types: functions and procedures.
Function A subroutine that
A function is a subroutine that returns a value once it has finished executing. returns a value.
A typical use of a function is to carry out a calculation and return the result. Procedure A subroutine
that does not return a value.

1 Fundamentals of programming
A procedure is a subroutine that does not return a value. A typical use of a
Module A file that contains
procedure is to display some data and/or prompts to the user.
one or more subroutines
Subroutines can be grouped together in a file to form a module or library. that can be imported and
These subroutines can then be re-used in other programs. used in another program.
Library A collection of
It is common to import libraries that have already been written to help solve modules that provide
problems; for example, in Java import java.util.* or, in Python, import related functionality.
random.

Now test yourself

40 State three advantages for using subroutines.


41 Explain why it is important for subroutines to have meaningful identifiers.
42 What is the name for a subroutine that doesn’t return a value?
43 What is the name for a subroutine that does return a value?

Answers available online

Parameters
The parameters of a subroutine are the variables that must be passed to a Parameters The variables
subroutine when it is called. This is declared when the subroutine is written. that a subroutine needs in
For example, in the code Procedure DisplayTemperature(int Temp, order for the subroutine
bool Celsius), the subroutine called DisplayTemperature needs to be passed to run.
an integer value and a Boolean value. Arguments The actual
values that are passed to
When a subroutine is called, the values must be passed as arguments; for the subroutine at runtime.
example, DisplayTemperature(20,True).

Returning a value
Functions must always return a value at the end of their execution. This is Return To pass a value or the
carried out with a return statement. contents of a variable back
For example: to the place in the program
where the function was called.
Function Double(int StartVal)
return 2*StartVal Now test yourself
End function 44 Describe what is meant
The value that is returned is passed back to the part of the program that by the term parameter.
called the function. 45 Explain the purpose of a
return statement.
It is possible for a subroutine to have several different return statements – for
example, within a selection structure – but the subroutine will stop once a Answers available
value has been returned. online

Local variables
When a subroutine is called, any variables passed as parameters and any Local variables Variables
variables declared within that subroutine are referred to as local variables. that are declared within a
These variables can only be accessed within that subroutine and will be subroutine and can only be
destroyed once the subroutine has finished executing. This is referred to as accessed by the subroutine
the scope of the variable. during the execution of that
subroutine.
Scope The visibility of variables
(either local or global).
19

My Revision Notes AQA A-level Computer Science Third Edition


325487_01_MRN_AQA_CS_001-033.indd Page 20 6/29/21 9:40 PM f-0116 /103/HO02206/work/indd

The advantages of local variables are:


✚ uses less memory as local variables are destroyed once the subroutine has
finished executing
✚ less likely to accidentally change the value of a variable somewhere else in
1 Fundamentals of programming

the program
✚ easier to debug
✚ variable identifiers can be re-used in separate subroutines Modular Independent of
✚ subroutines can be more easily re-used (subroutines are modular). other subroutines.

Knowing that local variables are destroyed once that section of code has
finished executing, it is important to note that variables declared within a
selection statement or iteration structure will also be destroyed at the end of
that section of code. It is therefore very important to choose carefully where
in the program a variable will be declared.

Global variables
Global variables are variables that are declared in the main program and can
Global variables Variables
be read or altered in any subroutine.
that can be accessed from
Accessing global variables from within subroutines reduces the need for any subroutine.
passing parameters and using return statements but should generally be
avoided where possible.
Making links
Global variables are, however, useful for named constants.
Try to limit your use of
Now test yourself global variables when
working on your NEA
46 Explain what is meant by the scope of a variable. programming project. Using
47 Explain three advantages of using local variables. a modular structure for your
subroutines will increase
48 Explain three disadvantages of using global variables.
the range of marks you are
49 Describe a situation where it would be appropriate to use a global variable able to access.
Answers available online

Stack frames
When a subroutine is called a stack frame is created. This stack frame
contains: Stack frame The collection
✚ the return address – where to return to in the program once the subroutine of data associated with a
has finished executing subroutine call.
Call stack A data structure
✚ parameters – the variables to which data was passed when the subroutine
that stores the stack frames
was called
for each active subroutine
✚ local variables – any variables declared within that subroutine.
while the program is running.
Newly called subroutines are added to the top of the call stack and the top
stack frame is removed once that subroutine has been completed.
Exam tip
Making links Make sure you can recall
Stacks are a complex data structure with a variety of uses in programming. Stacks and the three things stored
other complex data structures are explored further in Chapter 2. in a stack frame as this
is a common question in
Section A.
Now test yourself

50 What three things are stored in a stack frame?


Note
51 When is a new stack frame created? If a program becomes stuck
52 Where are stack frames stored? in a loop that continually calls
one or more subroutines then
Answers available online eventually the call stack will
become too full, triggering a
20 stack overflow error.

Check your understanding and progress at www.hoddereducation.co.uk/myrevisionnotesdownloads


325487_01_MRN_AQA_CS_001-033.indd Page 21 6/29/21 9:40 PM f-0116 /103/HO02206/work/indd

Recursive techniques
Some algorithms are best solved by solving smaller and smaller instances
Recursion The process of
of the same problem. To achieve this, a function must call itself repeatedly –
a function repeatedly calling

1 Fundamentals of programming
this is known as recursion. One example of recursion is used in calculating a itself.
factorial.
A factorial is calculated by multiplying a number by all of the integers less
than itself. The ‘!’ is used as the mathematical symbol for ‘factorial’. For
example:
5! = 5 × 4 × 3 × 2 × 1
This can be simplified as 5 × 4!
4! = 4 × 3!
3! = 3 × 2!
2! = 2 × 1!
1! = 1
A recursive subroutine will continue to call itself (known as the general case) General case A case in
until it reaches a decision that returns a value without calling itself (known as which a recursive function is
the base case or terminating case). called and must call itself.
Base case The case in
The pseudo-code algorithm for a factorial calculator might read: which a recursive function
Function Factorial (int n) terminates and does not call
itself.
IF n <= 1 THEN
RETURN 1
Exam tips
ELSE
Following a recursive
RETURN n * Factorial (n-1) algorithm can be very tricky
and it is important to get
END IF
lots of practice using trace
End Function tables to step through
recursive algorithms.
If n = 1 or less then the function cannot attempt to break the task down
any further, and should stop calling itself recursively, returning the result of Section B questions can
1 (1! = 1). This is the base case. require the use of recursion
to achieve full marks,
In all other cases the function will call itself. This is the general case. though a non-recursive
It is possible to have more than one general case and more than one base case. solution will always be
possible.
Now test yourself

53 What is meant by a recursive function? Making links


54 Explain what is meant by the base case in a recursive algorithm. While Sections B and D
55 Explain what is meant by the general case of an algorithm. may assess your ability to
write program code using
56 Using the pseudo-code for a factorial calculator, above, state the maximum
recursive techniques,
number of stack frames on the stack when calculating Factorial(4).
Sections A and C may
Answers available online require you to demonstrate
your ability to hand trace a
recursive algorithm. Trace
Revision activity tables are covered in more
detail in Chapter 4.
✚ Use the pseudo-code provided to program and test a working factorial calculator.
✚ Use a debugger to step through the factorial calculator and inspect the stack frames.
✚ Create a program that uses recursion to display the Fibonacci sequence
(in which the previous two numbers are added to get the next one; for example,
1,1,2,3,5,8,13…).

21

My Revision Notes AQA A-level Computer Science Third Edition


325487_01_MRN_AQA_CS_001-033.indd Page 22 6/29/21 9:40 PM f-0116 /103/HO02206/work/indd

Programming paradigms
Programming paradigms
1 Fundamentals of programming

A programming paradigm is a way to classify a programming style or


Paradigm A particular style
approach, based on its features and its approach. For Component 1 you are
or approach to designing a
expected to have studied:
solution to a problem.
✚ procedural-oriented programming
Procedural-oriented
✚ object-oriented programming.
programming An
Each paradigm is discussed in more detail below, and it is expected that you approach to solving a
will have had practice programming using both paradigms throughout your problem using subroutines
preparation for the exam. to tackle smaller sub-
problems.
Exam tip Object-oriented
programming An
Study the skeleton program carefully to help predict what kinds of questions you might
approach to solving a
be asked. If the skeleton program uses object-oriented techniques then it is more likely
problem using a model
that any questions on this topic will appear in Section C and will refer to the skeleton
based on real-world objects
code and pre-release scenario. If the skeleton code doesn’t use object-oriented
that are designed to interact
techniques then it is more likely that questions on procedural-oriented programming
in a realistic way.
will appear in Section C, and Section A will include some more generic questions on
object-oriented programming.

Now test yourself

57 What is the meaning of the term programming paradigm?


58 What are the two programming paradigms that you should know?
59 Which paradigm uses a model based on real-world objects?

Answers available online

Procedural-oriented programming
Procedural-oriented programming is designed to allow programmers to use a
Making links
structured, top-down approach to solve a given problem.
For more on subroutines
The program designer uses decomposition to break the problem down into
see the section Purpose of
increasingly small sub-problems, each of which can then be solved using a
subroutines above on
subroutine (either a function or a procedure).
page 18.
The main program will then be constructed by calling subroutines which will,
in turn, call other subroutines in order to solve the original problem. Top-down approach
A method of planning
Data can be passed to subroutines and values can be returned from them,
solutions that starts with
allowing the different parts of the program to interact with each other.
the big picture and breaks
This type of computer program is generally simpler to understand and the it down into smaller sub-
subroutines can be re-used at different points in the program without needing problems.
to copy it. This type of program is very modular and can easily be updated by Decomposition A
changing one subroutine. method of solving a larger
problem by breaking it up
into smaller and smaller
Hierarchy charts problems until each
Procedural-oriented programs can be represented using hierarchy charts. problem can’t be broken
Simple hierarchy charts show the relationship between subroutines, such down any further.
as the chart shown in Figure 1.1, with lines used to connect subroutines Hierarchy charts A
wherever one subroutine calls another. diagram that shows which
subroutines call which other
subroutines. More complex
versions will also show what
22 data is passed and returned.

Check your understanding and progress at www.hoddereducation.co.uk/myrevisionnotesdownloads


325487_01_MRN_AQA_CS_001-033.indd Page 23 6/29/21 9:40 PM f-0116 /103/HO02206/work/indd

Exam tip
Program
Questions involving
hierarchy charts almost

1 Fundamentals of programming
exclusively appear in
Section C, referring to the
Initialise Input Process Output
skeleton program, and
usually involve a ‘fill the
gaps’ style of question.
Make your own hierarchy
Capture
Enter data Validate charts when studying
form
the skeleton code to help
you understand how the
subroutines fit together and
Figure 1.1 A simple hierarchy chart
see past papers for example
of this style of question.
Now test yourself

60 How is decomposition used when designing solutions using procedural-oriented


programming?
61 In a hierarchy chart, what is the meaning of a line connecting two subroutines?

Answers available online

Revision activity
✚ Open a complex program you have been working on in your lessons and create a
hierarchy chart to show the relationships between each subroutine.
✚ Consider the steps involved in a two-player game such as Rock-Paper-Scissors
or Noughts & Crosses. Create a hierarchy chart to show how the game could be
broken down into subroutines and how those subroutines would be related.

Object-oriented programming
Classes
Object-oriented programming (often referred to as OOP) uses a different
Class The definition of the
approach to programming. attributes and methods of a
The programmer thinks about real-world objects and creates a class to group of similar objects.
describe the attributes and methods for that type of object. For instance, in Attributes The properties
Figure 1.2, the class called Customer has: that an object of that type
✚ the attributes: Name, Address, and Date of birth has, implemented using
✚ the methods: Edit customer and Delete customer. variables.
Methods Processes or
Customer Account actions that an object
of that type can do,
Name
Account number implemented using
Address Attributes subroutines.
Balance
Date of birth
Edit customer Check balance
Methods
Delete customer Add interest
Figure 1.2 Classes containing attributes and methods

Attributes are implemented using variables to hold the relevant data.


Methods are implemented using subroutines to carry out each action.

23

My Revision Notes AQA A-level Computer Science Third Edition


325487_01_MRN_AQA_CS_001-033.indd Page 24 6/29/21 9:40 PM f-0116 /103/HO02206/work/indd

Objects Object A specific


When the program is run, objects are instantiated (created) based on the class instance of a class.
definitions. Once instantiated, the object is stored in a variable. Instantiation The
process of creating an
1 Fundamentals of programming

object based on its class


Note
definition.
The object is stored in memory and the variable stores the memory address of that Constructor A special
object so that it can be accessed. method (with the same
name as the class) that is
called when the object is
When an object is created, a special method called the constructor is
instantiated.
called, and this will initialise the object, typically setting the attributes and
sometimes calling other methods.
Each instance of an object will have its own values for each attribute, but
all instances of that object will be able to carry out the same methods. For
instance, in Figure 1.3:
✚ the object Account1 is an instance of the class Account, with Account
number 12345 and a balance of £7.63
✚ Account2 is a different instance of the class Account, with a different
account number and balance.
All objects of this type have the same attributes, however the value of the
attributes can vary from object to object.

Account1 Account2 Account3


Account number: Account number: Account number:
12345 73526 92649
Balance +7.63 Balance -3,107.12 Balance +11,836.01
Check balance Check balance Check balance
Add interest Add interest Add interest
Figure 1.3 Three unique instances of an Account object

Now test yourself

62 What two features are defined in a class?


63 Describe the relationship between an object and its class.
64 What method is called when an object is instantiated?
65 When two objects of the same class are instantiated, describe the features of each
object which will definitely be the same and which might be different.

Answers available online

Encapsulation
Deciding how to structure and organise classes can be difficult, but the main
Encapsulation The
rule is to group together objects with common characteristics (attributes) and
concept of grouping similar
behaviours (methods). Keeping these features together in one class is called
attributes, data, and
encapsulation.
methods together in one
Encapsulation is useful because it means that program code is more modular. object.
This means that the code is easier to debug, can be re-used more easily and Information hiding
teams of programmers can work on individual classes without needing to Controlling access to data
know how other classes are programmed – they only need to know what stored within an object.
methods can be accessed.
Encapsulation is also helpful as it allows for information hiding, in which the
data stored in the attributes can be kept within that object and access to that
data can be controlled.

24

Check your understanding and progress at www.hoddereducation.co.uk/myrevisionnotesdownloads


325487_01_MRN_AQA_CS_001-033.indd Page 25 6/29/21 9:40 PM f-0116 /103/HO02206/work/indd

Access specifiers Access specifier (or


Each attribute (variable) and method (subroutine) within a class has an access modifier) A
access specifier (also commonly known as an access modifier) which controls keyword that sets the
whether other objects are able to directly interact with it. accessibility of an attribute

1 Fundamentals of programming
or method.
Access specifier Symbol Attributes Methods
Public An access specifier
public + can be viewed or updated can be called by any that allows that attribute or
by any object of any class object of any class method to be accessed by
private - cannot be viewed or cannot be called by any any other object.
updated by any other other object, regardless Private An access specifier
object, regardless of class of class that protects that attribute
or method from being
protected # can only be viewed or can only be called by this
accessed by any other
updated by this object object or another object
object.
or another object of that of that class, or a subclass
Protected An access
class, or a subclass
specifier that protects that
The convention is to declare attributes as private so that other objects cannot attribute or method from
directly interact or affect the values that are stored. This make it less likely being accessed by other
objects unless they are
that a class written by another programmer could adversely affect the overall
instances of that class or a
program.
subclass.
To allow access to those data, a class should include getters and setters – Getter A function used
public methods that allow other objects to ask an object to return the value of to return the value of an
a specific attribute, or that ask an object to update a value. attribute to another object.
One example might be a game character that has a score and a number of Setter A procedure used to
lives which are both set to private, and uses public methods to allow other allow another object to set
objects to interact with those values: or update the value of an
attribute.
Character = Class
Private:
Revision activity
Score: Int
✚ Using pseudo-code,
Lives: Int describe the class
Public: attributes and methods
required for a virtual pet.
Function GetScore() ✚ Design and build
Function GetLives() an object-oriented
program that uses a
Procedure AddPoints() Calculator class
Procedure LoseALife() with methods such as
Press0, Press1,
Procedure GainExtraLife() PressPlus and
End Class PressEquals.

Now test yourself

66 Identify three things that are grouped together using encapsulation.


67 Suggest two advantages of using encapsulation.
68 State the name, symbol and meaning for the three main access specifiers.
69 Which access specifier should be used, by default, for attributes? Inheritance The idea
that one class can use the
70 Explain how it is possible for private attributes or methods to be accessed by other
attributes and methods
objects.
defined in another class.
Answers available online Subclass (or child class)
A class that inherits the
attributes and methods
Inheritance from another class.
Inheritance describes an ‘is a’ relationship between classes. For example, a Base class (or parent
horse is a type of animal. class) A class whose
attributes and methods are
To implement this, subclasses (or child classes) inherit attributes and inherited by another class. 25
methods from a base class (or parent class).

My Revision Notes AQA A-level Computer Science Third Edition


325487_01_MRN_AQA_CS_001-033.indd Page 26 6/29/21 9:40 PM f-0116 /103/HO02206/work/indd

This means that the same code can be re-used without needing to be copied,
Revision activity
and if the code needs to be changed then it only needs to be changed in the
base class, reducing the risk of errors and making it easier to debug. ✚ Design a base
class, Room, and
In class diagrams, inheritance is showing using a hollow arrow, which always
1 Fundamentals of programming

subclasses Kitchen,
points towards the base class.
LivingRoom and
Bedroom. Consider
Account
the attributes that could
be inherited and those
Current Mortgage
which must be declared
in the subclasses.
✚ Design classes that
Figure 1.4 An inheritance diagram
could be used to model
Figure 1.4 shows a class structure in which two types of account (Current and various forms of public
Mortgage) are subclasses will inherit the attributes and methods from the transport, including
Account base class. buses, taxis and trains.

Exam tip
Exam tip
In AQA Pseudo-code, subclasses are declared by adding the base class name in
parentheses; for example: The terms subclass
Dog = Class (Animal) and child class are
It is rare for the exam to ask students to describe a class using pseudo-code. However, interchangeable and both
when this is the case, then language-specific syntax is accepted; for example: mean the same thing.
Dog = Class extends Animal The terms base class
and parent class are also
interchangeable. It is helpful
Subclasses will have additional properties and methods specific to that type
to either use the terms
of object (for example, a current account might have a withdrawal limit or the
subclass and base class
ability to allow an overdraft, whereas a mortgage account might have a fixed
OR child class and parent
end-date and the ability to allow a payment holiday).
class for consistency, but
Both subclasses will inherit the attributes and methods from the base class both sets of terminology are
(that is, they both have an account number and a balance and both have acceptable.
methods for checking the balance and adding interest).

Now test yourself

71 Suggest equivalent terms for child class and parent class.


72 What symbol is used to show an inheritance relationship on a class diagram, and Aggregation The idea that
which direction does it point? one class can be related
to another using a ‘has a’
73 Suggest two advantages of using inheritance.
relationship.
Answers available online Container class (or
container object) A class
or object that contains, or is
Aggregation made up of, other objects.
Aggregation describes a ‘has a’ relationship between classes; for example, a Associated class (or
building has a room. associated object) A class
In the implementation of aggregation, one container object contains a or object that is used to
reference to an associated object as an attribute (variable). make up another object.
Association aggregation
There are two types of aggregation: A type of aggregation
✚ association aggregation where the container object
✚ inheritance aggregation. can be destroyed without
destroying its associated
Association aggregation objects.
In association aggregation the two types of object are associated with each Composition aggregation
other, but not dependent on each other. A type of aggregation
If the container object is removed or destroyed, the associated objects are where, if the container
undamaged. In a real-world example, employers and managers in a business object is destroyed, its
all have a job role. A business that is changing the way it works may decide associated objects are also
a certain role is no longer needed. However removing the job role does not destroyed.
26 remove the employees and managers – they are still part of the business.

Check your understanding and progress at www.hoddereducation.co.uk/myrevisionnotesdownloads


325487_01_MRN_AQA_CS_001-033.indd Page 27 6/29/21 9:40 PM f-0116 /103/HO02206/work/indd

In class diagrams, association aggregation is shown using a hollow diamond,


which always points towards the container class.

Job Role

1 Fundamentals of programming
Manager Employee

Figure 1.5 Class diagram showing association aggregation

Composition aggregation
Composition aggregation describes a more dependant relationship in which
the container object is directly made up (composed) of the associated objects.
If the container object is removed or destroyed then so are the associated
objects. In our example the container object Workforce is made up of
managers and employers. Removing Workforce from the model altogether
results in the removal of the employees and managers.
In class diagrams, composition aggregation is shown using a filled diamond,
which always points towards the container class.

Workforce

Manager Employee

Figure 1.6 Class diagram showing composition aggregation

Now test yourself

74 What is the difference between inheritance and aggregation?


75 Describe the difference between association aggregation and composition
aggregation.
76 State which symbols are used to show each type of aggregation on a class diagram.
77 In a computer model featuring a Room class, a Window class and a Door class,
which class is the container class?

Answers available online

Polymorphism
Polymorphism means ‘many forms’. It covers the potential scenario of having Polymorphism Literally
two or more methods with the same name. ‘many forms’ – the ability for
✚ A method to ring(PhoneNumber) would involve dialling that specific two methods with the same
number. name to carry out their
✚ A method to ring(Name) would involve looking up the phone number for actions using different code.
the person you want to ring and then ringing that number. Overriding A method in
a subclass re-defining a
Both methods have the same name, but different parameters. By looking
method inherited from a
at the data type of the value that is passed, the object can identify which
base class.
method to use.
Having methods with the same names but different parameters means that
the same basic goal can be achieved using different steps, or methods, and is
Exam tip
a common feature in object-oriented programming. Look carefully through
the skeleton code for any
Overriding examples of polymorphism.
If there are any then this is a
Overriding is the situation where a base class has a method and a subclass
likely question to appear in
has a method of the same name, but with different steps. The subclass Section C.
method overrides (takes priority over) the method from the base class.
For example, an Account class can have a method CloseAccount that
transfers the remaining balance to the customer.
27

My Revision Notes AQA A-level Computer Science Third Edition


325487_01_MRN_AQA_CS_001-033.indd Page 28 6/29/21 9:40 PM f-0116 /103/HO02206/work/indd

A Mortgage class is a subclass and inherits the CloseAccount method, but


in this case the CloseAccount method needs to be re-written so that the
account can only be closed if the mortgage has been paid off.
1 Fundamentals of programming

Now test yourself

78 Explain what is meant by the term polymorphism.


79 Explain what is meant by the term overriding.
80 How can a computer identify which method to run if there are two methods with
identical identifiers in that class?

Answers available online

Revision activity
✚ Create flashcards for each piece of key vocabulary in this chapter.
✚ Examine the skeleton program for your Component 1 exam, or a previous skeleton
program, and identify as many examples of instantiation, inheritance, aggregation,
polymorphism and overriding as possible.

Why object-oriented programming is used


There are several advantages for choosing object-oriented programming over
procedural-oriented programming.
✚ OOP more closely represents the real world, which is made up of objects of
various types.
✚ Program code is easier to debug as each class is modular.
✚ Classes can be re-used in other programs.
✚ Code can be re-used through inheritance and aggregation.

Object-oriented design principles


There are three main design principles you are expected to be familiar with:
✚ encapsulate what varies
✚ favour composition over inheritance
✚ program to interfaces, not implementation.
Encapsulate what varies
This means that in the design stage a programmer should try to identify the
features of a model that are likely to change in the future and encapsulate
those features.
One example is a method designed to display the number of wheels that a
vehicle has, using a selection statement:
IF Vehicle.Type = "bicycle" THEN
OUTPUT "Vehicle has 2 wheels"
ELSE IF Vehicle.Type = "car" THEN
OUTPUT "Vehicle has 4 wheels"
ELSE IF Vehicle.Type = "boat" THEN
OUTPUT "Vehicle has 0 wheels"
Making links
ENDIF
Object-oriented design
A better design would use encapsulation to store the number of wheels as principles go alongside
part of a vehicle class: software development
principles, covered in
OUTPUT "Vehicle has " + Vehicle.NumberOfWheels + " wheels"
Chapter 13. Clear definition
This means that if the program is changed to add a tricycle vehicle type, there and analysis of a problem
is no need to change the existing code. will directly inform the
object-oriented code
The use of inheritance can also make it much easier to encapsulate features
design.
28 or behaviours that vary, using the technique of overriding within subclasses.

Check your understanding and progress at www.hoddereducation.co.uk/myrevisionnotesdownloads


325487_01_MRN_AQA_CS_001-033.indd Page 29 6/29/21 9:40 PM f-0116 /103/HO02206/work/indd

Favour composition over inheritance


Composition aggregation and association aggregation provide a more flexible
relationship between classes than inheritance.
This is advantageous because each class can be tested independently of other

1 Fundamentals of programming
classes, which is not true for subclasses.
Changing a base class can cause unexpected side-effects in subclasses,
so using composition rather than inheritance means it is safer to update
program code in the future.
A particular problem with inheritance is that a subclass can’t inherit from two
different classes at once. This means that if a new behaviour is common to
two different classes then it may not be easier to re-use code without copying
it into both classes.

Program to interfaces, not implementation


Interfaces are a special concept which can be used to group similar Interface A collection of
behaviours together and make them available to unrelated classes that have subroutines that can be
access to that interface. implemented by unrelated
classes.
For example, a Dog class might have access to an interface called Annoy,
which will call the methods Bark and ChewSlippers. A Person class might
also have access to the interface called Annoy, and in this class it will call the
methods TalkLoudly and PickNose.
By grouping both sets of behaviours into one interface, a programmer can
make either type of object ‘annoy’ without concerning themselves with the
actual implementation of how each unrelated class will carry out that process.
This technique uses a mixture of encapsulation (grouping similar behaviours
together) and abstraction (hiding the complexity of what is happening).

Now test yourself

81 Describe three advantages of using object-oriented programming.


82 Explain why composition is preferable to inheritance.
83 Which design principle involves the grouping together of similar behaviours with
unrelated classes?
84 Which design principle involves the grouping together attributes or methods that
are likely to be changed in the future?

Answers available online

Writing object-oriented programs


It is important to be familiar with the syntax of your chosen programming
language.
For each of the following, these techniques may be present in the skeleton
program and you may be required to make use of them, but you are unlikely
to be asked direct questions about them.
Abstract method A
Abstract methods are declared but contain no program code. These are
method that has no
sometimes used in base classes to create the requirement to override a
program code and is
method. An example may be a Speak method in an Animal class that must
intended to be overridden.
be overridden for each of the Dog, Cat and Parrot subclasses.
Virtual method A method
Virtual methods are methods that may be overridden. In some languages that may be overridden
(Java and Python) all methods are virtual by default. In other languages (C#, (this is the default in many
Delphi/Pascal and Visual Basic) methods must be declared as virtual in the languages).
base class if they are to be overridden. Static method A method
within a class that can be
Static methods are methods that can be called within a class without the need
called without the need
to create an object of that class. This means less memory usage as the program
to create an object of that
doesn’t need to create the object in order to be able to run those methods and class. 29
should be used when any object should be able to make use of those methods.

My Revision Notes AQA A-level Computer Science Third Edition


325487_01_MRN_AQA_CS_001-033.indd Page 30 6/29/21 9:40 PM f-0116 /103/HO02206/work/indd

Exam tip Exam tip


Study the skeleton program carefully and make sure you can identify any examples It is easy to forget the
of each concept and technique mentioned in this chapter. It is likely that a question exact meaning of each
1 Fundamentals of programming

on that concept will appear in Section C and it is possible you will be expected to use relationship symbol. Make
those techniques when writing your own program code for Section D. sure you remember the
following.
✚ Inheritance is shown
Class diagrams using a hollow arrow,
The design of classes can be described using a class diagram, using arrows which always points
and diamonds to describe the relationships towards the base class.
✚ Association aggregation
Simple class diagrams just show the names of classes and the relationships
is shown using a hollow
between them.
diamond, which always
More detailed class diagrams show the attributes and methods within each points towards the
class as well. container class.
✚ Composition
These diagrams show the name of the class in the top section, attributes in aggregation is shown
the middle section and methods in the bottom section, along with access using a filled diamond,
specifiers. which always points
towards the container
Base class or parent class
class.
Account
– AccountNumber: String
– OpeningDate: Date
– CurrentBalance: Currency
– InterestRate: Real
+ GetAccountNumber()
+ GetCurrentBalance()
# AddInterest()
+ SetInterestRate

Revision activity
✚ Create a class diagram
Current Mortgage
that could be used
– PaymentType: String to model a house,
– Overdraft: Boolean – EndDate: Date including a House
Subclasses or container class and
+ SetPaymentType() + GetEndDate() associated classes that
child classes
+ SetOverdraft() + SetEndDate() include Kitchen,
LivingRoom,
+ GetOverdraft() Bedroom and
Garden. Consider the
Figure 1.7 A class diagram showing the design for different types of account
relationship between
Note the way that attributes are described using Identifier: Data Type. each class.
✚ Examine the skeleton
Now test yourself program for your
Component 1 exam,
85 What type of method can be called even if an object of that class has not been or a previous skeleton
instantiated? program, and create a
86 What key word means that a method can be overridden? detailed class diagram
87 What type of method must be overridden? to show attributes and
methods in each class as
88 Identify six things should be included in a detailed class diagram.
well as the relationships
Answers available online between them.

30

Check your understanding and progress at www.hoddereducation.co.uk/myrevisionnotesdownloads


325487_01_MRN_AQA_CS_001-033.indd Page 31 6/29/21 9:40 PM f-0116 /103/HO02206/work/indd

Summary

Programming ✚ In object-oriented programming the programmer


✚ Each variable has an address in memory, an identifier, designs a program around the attributes and

1 Fundamentals of programming
a data type and a value. It is important to choose a behaviours of real-world objects
meaningful identifier ✚ A class contains the attributes (variables) and methods
✚ Named constants are variables whose values cannot (subroutines) associated with that type of object and
be changed while the program is running functions as a blueprint for how objects of that class
✚ Selection is used to decide which block of code to will behave
execute and is implemented using an IF or SWITCH ✚ Objects are instances of a specific class and
statement instantiated by calling their constructor
✚ Iteration is used to repeat a block of code and either ✚ The process of grouping objects with common
uses a count-controlled (FOR) loop if the number of attributes and behaviours together is called
repetitions is known or a condition-controlled (WHILE encapsulation
or DO-WHILE) loop if the number of repetitions is not ✚ Access to an object’s attributes and methods is
known controlled using access specifiers
✚ Arithmetic operators include basic arithmetic, plus ✚ It is common for all attributes to be declared as private,
rounding, truncation and the use of DIV and MOD and for setter and getter methods to be declared as
✚ Relational operators can be combined with Boolean public in order to allow other objects to interact in a
operators to create more complex conditions controlled manner
✚ String handling operations include the basic skills of ✚ Inheritance describes an ‘is a’ relationship. A subclass
finding the length, addressing specific positions and will inherit the attributes and methods of a base class
concatenation (joining) of strings, as well as extracting ✚ Aggregation describes a ‘has a’ relationship. A
substrings, converting to and from the numeric container class will be linked to one or more associated
character codes and converting data types classes
✚ It is important to be able to use random number ✚ In association aggregation, if the container class
generation and exception handling in your is destroyed then the associated classes will be
programming untouched
✚ Exception handling is an important tool when a block of ✚ In composition aggregation, if the container class
code has a chance of failure (for example, opening a file is destroyed then the associated classes will be
that may not exist, or processing user inputs that may destroyed as well.
be in the wrong format) ✚ Polymorphism is the term for using having two or more
✚ Subroutines allow for code to be re-used. Parameters methods with the same identifier in the same class,
describe the data that must be passed to a subroutine but using different parameters to allow the program to
when it is called decide which method to run
✚ Functions are subroutines that return a value. ✚ Overriding is the term for a subclass having a method
Procedures are subroutines that do not return a value with the same identifier as a method in the base class;
✚ Local variables are preferable to global variables the method in the subclass will always take precedence
in most cases as they use less memory, make ✚ There are three design principles to remember:
subroutines more modular and make programs easier ‘Encapsulate what varies’, ‘Favour composition
to read and debug. over inheritance’ and ‘Program to interfaces, not
✚ Stack frames contain the return address, parameters, implementation’
and local variables of a subroutine call while it is ✚ You should not be asked about abstract, virtual and
running static methods but these may appear in the skeleton
✚ A recursive function is a function that calls itself. It code
must include at least one base case, a point at which ✚ Class diagrams should always show the name of the
the function will stop calling itself class, the attributes for that class (including data types
and access modifiers) and the methods for that class
Programming paradigms (including access modifiers)
✚ There are two main programming paradigms to study – ✚ Inheritance is shown using a hollow arrow that points
procedural-oriented programming and object-oriented towards the base class
programming ✚ Association aggregation is shown using a hollow diamond
✚ In procedural-oriented programming the main problem that points towards the container class
is broken down into smaller sub-problems, each of ✚ Composition aggregation is shown using a filled diamond
which is solved using a subroutine that points towards the container class
✚ Hierarchy charts are used to show which subroutines
call other subroutines

31

My Revision Notes AQA A-level Computer Science Third Edition


325487_01_MRN_AQA_CS_001-033.indd Page 32 6/29/21 9:40 PM f-0116 /103/HO02206/work/indd

Exam practice

1 Dave has been asked to write a program as part of a project looking at rainfall. At the end of a week the user of the
program will enter the total rainfall (measured in mm) for each one of the last seven days as a number with one
1 Fundamentals of programming

decimal place. The program should calculate and then output:


✚ The amount of rain that fell on the day with the least rainfall.
✚ The amount of rain that fell on the day with the most rainfall.
✚ The total amount of rainfall for that week.
✚ The mean average amount of rainfall for that week.
a) An iterative structure should be used in the program described above. Explain whether a count-controlled or
condition-controlled iteration structure would be most suitable, and why. [2]
b) Write a program using your chosen programming language that will solve the problem described above. [10]
c) Show the output of the program when the following values are input. [1]
2.2 7.6 1.4 3.1 2.7 1.5 3.2
2 In the following table, the first column contains pseudo-code for an algorithm that will check to see if a piece of text is
a palindrome (a word or phrase that reads the same forwards or backwards).
The second column contains pseudo-code for a recursive algorithm that will carry out the check.
The subroutine Length() will return the number of characters in a given string.
The subroutine Substring(start,end) will return the string starting from position start and
ending at position end. For example "Message".Substring(2,5) will return "ssag".

FUNCTION Palindrome()
OUTPUT "Enter a word or phrase"
Phrase ← INPUT
Result ← PCheck(Phrase)
IF Result = TRUE THEN
OUTPUT "This is a palindrome"
ELSE
OUTPUT "This is not a palindrome"
ENDIF
ENDFUNCTION

FUNCTION PCheck(Phrase)
NumChars = Length(Phrase)
IF NumChars < 2 THEN
RETURN TRUE
ELSEIF Phrase[0] = Phrase[NumChars-1] THEN
RETURN PCheck(Phrase.Substring(1,NumChars-2))
ELSE
RETURN FALSE
ENDFUNCTION

a) Explain what is meant by a recursive algorithm. [1]


b) Explain what is meant by a base case, and describe one base case from the subroutine PCheck. [2]
c) Write a program in your chosen language that will ask the user to enter a word or phrase and check if it is a
palindrome without using recursion. [7]
d) Show the output of the program when the word “RACECAR” is entered. [1]
e) Show the output of the program when the word “BEAR” is entered. [1]

32

Check your understanding and progress at www.hoddereducation.co.uk/myrevisionnotesdownloads


325487_01_MRN_AQA_CS_001-033.indd Page 33 6/29/21 9:40 PM f-0116 /103/HO02206/work/indd

3 This class diagram is a partial representation of the relationships between some of the classes in a program for a
garage.
Vehicle

1 Fundamentals of programming
- Registration: String
- Colour: String
- New: Boolean
- Owner: Owner
+ GetDetails()
# ChangeColour()
+ ChangeOwner()

Person Car Van


- Name: String - NumberOfDoors: Integer - WheelBase: String
- Email: String
+ GetDetails() + GetDetails()
+ GetDetails() # ChangeColour()
+ UpdateEmail()

a) State the identifier of a base class. [1]


b) State the identifier of a subclass. [1]
c) State the access specifier for the attribute Registration. [1]
d) State the identifier of a protected method. [1]
e) The method ChangeColour appears in both the Vehicle class and the Van class. State the name of
the concept that allows this to happen. [1]
f) Identify the relationship between the Car class and the Vehicle class. [1]
g) Identify the relationship between the Person class and the Vehicle class. [1]
4 a) Explain the difference between a public method and a protected method. [2]
b) Give two reasons why most attributes in object-oriented programming are declared as private and
methods such as GetDetails or UpdateScore are used to access them. [2]
c) Explain the meaning of the phrase favour composition over inheritance. [2]
5 A program is used to store and process the details of students in a college. The Student class contains several
attributes and methods, including two methods named Student.
When a new student is added to the program then one of these methods must be run.
PRIVATE PROCEDURE Student ()
// Some code
ENDPROCEDURE
PROCEDURE Student (Name, DoB, Email)
// Some code
ENDPROCEDURE
a) State the process for creating a new object based on its class. [1]
b) State the name for a method that must be run when an object of that class is created. [1]
c) State the name for the concept that allows there to be two methods with identical identifiers in one class. [1]
d) Explain how it is possible for the computer program to decide which method to run when the method
Student is called. [3]

33

My Revision Notes AQA A-level Computer Science Third Edition


325487_02_MRN_AQA_CS_034-052.indd Page 34 6/29/21 10:01 PM f-0116 /103/HO02206/work/indd

2 Fundamentals of data structures

Data structures and abstract


data types
Data structures
Data structures are designed to hold several items of data at a time. This
Data structure The
makes it easier to manage, find, update and process data than to work with
concept of storing multiple
individual variables. values together with a
For instance, finding the biggest value from ten separate variables would single identifier.
require a separate selection statement to interrogate each one, and additional Array A data structure for
code would be needed each time the number of variables increased. holding values in a table.
Using a data structure called an array means that it is possible to step through
each item using a loop, reducing the amount of code and making the code
much more flexible .

Single- and multi-dimensional arrays


(or equivalent)
An array is a fixed-size collection of values, all of the same data type.
Index A value indicating the
Single-dimensional arrays position of a value with in
A single-dimensional array can be written down as a single row of a table. an array or list.

Each individual item in the array is referred to using the identifier (or List A data structure similar
variable name) of the array, followed by the index in brackets (usually square to an array, commonly used
in Python in place of an
brackets). Each index position can hold data.
array.
Index [0] [1] [2] [3] [4]
Data 1 3 5 7 11 Exam tip
In most languages (including
Note C#, Delphi/Pascal, Java &
VB.Net) the array index
Arrays are always declared as a fixed size and cannot be changed later in the program. starts at 0, but be very
In an array, all data must be of the same data type. careful when reading
Lists are very similar to arrays, however it is possible to alter the size of a list while the exam questions as some
program is running and it is possible to store data of differing types in the same list. languages and some
scenarios will have the array
In some languages (notably including Python) it is much more common to use a list, index starting at 1.
whereas in others it is much more common to use an array.
You are not expected or required to show your understanding of the difference
between the two, and you should use whichever version is most suitable for your
chosen programming language.

Arrays are an effective solution for storing several values because a FOR loop
can be used to iterate (or loop) over an array.
In this example Numbers is the name of an array and Length(Numbers)
returns the size of the array (the number of items is contains).
FOR i ← 0 TO Length(Numbers)
OUTPUT Numbers[i]
34
ENDFOR

Check your understanding and progress at www.hoddereducation.co.uk/myrevisionnotesdownloads


325487_02_MRN_AQA_CS_034-052.indd Page 35 6/29/21 10:01 PM f-0116 /103/HO02206/work/indd

This code will step through the items in the array n times, where n is the size
Making links
of the array. This code would work for all arrays regardless of their size. This
is far more efficient than stepping through several variables one at a time, as One-dimensional arrays
this would require a separate line of code for each variable and the program can be an effective way

2 Fundamentals of data structures


would need to be edited every time the number of items changed. of representing a vector.
Vectors are used in many
games and physical models,
Multi-dimensional arrays and are discussed in more
A two-dimensional array can be written down as a table. detail towards the end of
A two-dimensional array can be thought of as an array of one-dimensional this chapter.
arrays.
By identifying which row is being addressed using one array index, a
particular value can be addressed within that row using a second array index.
Numbers [0]

[0] [1] [2] [3]


[0] 1 3 5 7 Numbers [0][3]

Numbers [1]
Numbers
[0] [1] [2] [3]
[0] [1] [2] [3]
[1] 11 13 17 19
[0] 1 3 5 7
Exam tip
[1] 11 13 17 19 Numbers [2]
[2] 23 29 31 37
Arrays can also be defined
[0] [1] [2] [3]
using the first index to find
[3] 41 43 47 51 [2] 23 29 31 37
the column and the second
Numbers [2][2] index to find the item in that
Numbers [3]
column. Always read the
[0] [1] [2] [3] question carefully as any
[3] 41 43 47 51 ambiguities should be made
Numbers [3][1] clear.
Figure 2.1 A two-dimensional array called Numbers
Making links
In the example above the contents of Numbers[0][3] can be found by isolating
row 0 and then finding the item in position 3. One common use for a
two-dimensional array is
A two-dimensional array is useful because it can store more complex data; for
storing a matrix. Matrices
example, the scores for different students or values for different days.
are often used in complex
It is possible to find the size of a two-dimensional array using the Length maths, and can also be used
function (exact syntax varies by programming language). to represent a graph data
structure. This is explored
For an array with indexes defined as [row][column], to find the number of
further later in this chapter.
rows, find the number of one-dimensional arrays the table can be split into:
NumberOfRows ← Length(ArrayName)
Matrix A rectangular, two-
To find the number of columns, find the length of a row in the table: dimensional collection of
NumberOfColumns ← Length(ArrayName[0]) values.

To interrogate a two-dimensional array it is necessary to use nested loops. Nested A selection


statement or loop inside
FOR i ← 0 to Length(Numbers) // Step through each row another selection statement
FOR j ← 0 to Length(Numbers[i]) // Step through each or loop.
value in that row
OUTPUT Numbers[i][j] Exam tip

ENDFOR Make sure you are able to


hand trace a program such
ENDFOR as the one above to fully
Using the principle above, it is possible to think of a three-dimensional array understand which counter
as an array of two-dimensional arrays. variable is addressing the
row or column index of the
table. 35

My Revision Notes AQA A-level Computer Science Third Edition


325487_02_MRN_AQA_CS_034-052.indd Page 36 6/29/21 10:01 PM f-0116 /103/HO02206/work/indd

[0] [1] [2] [3]


Numbers [0] [0] 1 3 5 7
[1] 11 13 17 19 Numbers [0][1][3]
2 Fundamentals of data structures

[2] 23 29 31 37
[3] 41 43 47 51

[0] [1] [2] [3]


Numbers
Numbers [1] [0] 1 3 5 7
[0] [1] [2] [3]
[0] [1] [2] [3] [1] 11 13 17 19
[0] [1] [2] [3]
[0] 11[0] 33[1] 55[2] 77[3]
[0] [2] 23 29 31 37
[0] 11 33 55 77
[1][0] 11 13 17 19
[1] 11 13 17 19 [3] 41 43 47 51
[1] 11 13 17 19
[2][1] 23 11 29 13 31 17 37 19
[2] 23 29 31 37
[2] 23 29 31 37
[3][2] 41 23 43 29 47 31 51 37 [0] [1] [2] [3]
[3] 41 43 47 51
[3] 41 43 47 51 Numbers [2]
[3] 41 43 47 51 [0] 1 3 5 7
[1] 11 13 17 19
Numbers [2][1][2]
[2] 23 29 31 37
[3] 41 43 47 51

[0] [1] [2] [3]


Numbers [3] [0] 1 3 5 7
[1] 11 13 17 19
[2] 23 29 31 37
Numbers [3][3][1]
[3] 41 43 47 51

Figure 2.2 A three-dimensional array represented as an array of two-dimensional


arrays

Similarly, an array of n-dimensions is possible, where n is any positive integer.

Exam tip
While questions on two-dimensional arrays are quite common, three-dimensional
arrays are generally limited to potential skeleton programs and NEA programming
projects. Examine the skeleton code carefully for any examples of multi-dimensional
arrays.

Now test yourself

1 Explain the purpose of an index in an array


2 Describe two advantages for using an array of integers instead of several integer
variables.
3 True or false? All arrays start counting from 0.
4 What data structure is typically used instead of an array in Python?
5 True or false? It is not possible to have an array of more than four dimensions.
6 How many FOR loops need to be nested in order to interrogate a two-dimensional array?

Answers available online

Revision activity
✚ Create a two-dimensional array called MovieRatings. Populate the array with
film review ratings, with each row representing one review website and each
column representing one film.
✚ Create a menu and write program code that will allow the user to:
✚ find the min, max and mean average review score for each film
✚ find the min, max and mean average review score from each website
✚ find a specific review rating given the name of the film and the review website.
✚ Create a 2-dimensional array to store the game state for a game of noughts and
36 crosses.

Check your understanding and progress at www.hoddereducation.co.uk/myrevisionnotesdownloads


325487_02_MRN_AQA_CS_034-052.indd Page 37 6/29/21 10:01 PM f-0116 /103/HO02206/work/indd

Fields, records and files


A record holds groups of related items together, using fields. An example
might be a user record, containing fields to store the first name, last name Record A collection of

2 Fundamentals of data structures


and username for people logging onto a website. related data.
Field A category of data
First name Last name Username within a record or group of
Dave Smith Davo263 records.

Nicola Tandy NicTandy


Stephen Duffy DuffS17

Each item in a record can be a different data type, making a record more
complex than an array, but also more flexible.
There are many ways to implement a record, and this is handled differently in
different programming languages. Understanding and recognising records of
data and which fields are being used is the key concept.
One common concept when considering records is the importance of writing
records to a file.
Files are a way of permanently storing data which would otherwise be lost
File A persistent collection
once the program or subroutine has finished executing. of data, saved for access
Text files use a character set (such as ASCII or Unicode) to store the data as and accessible once the
text and typically use a delimiter such as a comma (,) or colon (:) to separate program or subroutine has
the individual items of data. These files are usually saved with a .txt or .csv finished running.
(comma separated value) file extension. Text file A file that uses
A saved file from a game of Noughts and Crosses might be saved like this as a text encoding (such as ASCII
.csv file, where a comma is used to separate each item of data. or Unicode) to store data.
Binary file A file that uses
X binary values to represent
each item of data.
O X

X O

-,X,-,-,O,X,-,X,O
An alternative is to save the game as a binary file. A binary file only stores
binary information, and needs a key to translate binary into particular items
of data. For instance, for the Noughts and Crosses game, using two bits per
cell, the following key could be used:

00 Empty

01 X

10 O

11 Not used Exam tip


Make sure you can identify
Then the saved game file would be stored as: the advantages and
disadvantages of using
000100 binary files versus text files.
001001 It is extremely unlikely that
you will be asked to write
000110 code to work directly with
The advantages of using a text file to store this data are that the data can be: binary files, though you
✚ read by other programs may choose to explore
✚ easily understood. this as part of your NEA
programming project. 37

My Revision Notes AQA A-level Computer Science Third Edition


325487_02_MRN_AQA_CS_034-052.indd Page 38 6/29/21 10:01 PM f-0116 /103/HO02206/work/indd

The advantages of using a binary file to store this data are:


✚ smaller file size
✚ data cannot be read by other programs (more secure).

Note
2 Fundamentals of data structures

For A-level it is only necessary to consider sequential file access. That is, reading files
from start to end, in order.

Exam tip
The syntax for writing to and reading from files varies significantly in different
programming languages. It is important to be familiar with file handling routines in
your chosen programming language and to look carefully for any file handling that
takes place in the skeleton program.

Now test yourself

7 What are the two types of file?


8 Describe one advantage and one disadvantage for using a binary file.
9 What is used to separate individual values in a .csv file?
10 Which of the following is correct: a field is made up of records, or a record is made
up of fields?

Answers available online

Revision activity
✚ Create a two-dimensional array to represent the state of a game of noughts and
crosses. Write program code that will:
✚ save the game state as a text file
✚ load a game state from a text file
✚ save the game state as a binary file
✚ load a game state as a binary file.
✚ Compare the file size of the text and binary files. Try opening both types of file in a
simple text editor (such as Notepad) and compare the contents.

Abstract data types/data structures


While most programming languages have built in data structures such as
arrays (or similar), more complex data structures are not always directly
supported.
Abstract data types can be implemented using a collection of existing tools,
typically involving the use of an array and one or more other variables. Each
one is discussed in more detail below. Abstract data type A
complex data structure in
They are referred to as abstract data types because the complexity of the data
which the complexity of
structure is hidden and a programmer can make use of them without needing
how the data is stored or
to be directly concerned with how they are implemented.
accessed is typically hidden
✚ Some data structures (including arrays) are static. That means that, once from the programmer.
declared, their size is fixed and cannot be increased or decreased.
✚ Static data structures are assigned a fixed amount of memory when Static The size of, and the
declared, making access to the values quick, however memory can be memory assigned to that
wasted if some spaces are left empty. data structure is fixed and
cannot be changed.
✚ Some data structures (including lists) are dynamic. That means that their
size is not fixed and they can grow and shrink as necessary. Dynamic The size of, and
the memory assigned to
Dynamic data structures are assigned memory as needed which uses
that data structure can
memory more efficiently, but accessing the data can be slower as the memory
change.
38 assigned to the data structure may become fragmented.

Check your understanding and progress at www.hoddereducation.co.uk/myrevisionnotesdownloads


325487_02_MRN_AQA_CS_034-052.indd Page 39 6/29/21 10:01 PM f-0116 /103/HO02206/work/indd

Queues
A queue data structure works in a very similar way to a queue in the real

2 Fundamentals of data structures


world.
Queue A data structure
Items are retrieved from the front of the queue and new items are added at in which items are stored
the rear of the queue. in the order in which they
The term for this type of data structure is First In, First Out (FIFO). should be accessed.

Common uses for queues include: First In, First Out (FIFO)
✚ buffering (storing data as it arrives until it can be processed) Those items placed into the
queue first will be the first
✚ simulating a card game (cards are drawn from the front and replaced at
ones to be accessed.
the back).
Pointer A value that stores
Making links an address. In the context
of queues this is usually the
Queues are a fundamental part of the breadth first search (BFS) which is explored in index of the front or rear
Chapter 3. item.

A queue can be implemented using a single-dimensional array and two


integer variables, referred to as the Front Pointer (FP) and the Rear Pointer (RP).

FP RP
[0] [1] [2] [3] [4] [5] FP 0
Dave Angelina Faaris RP 2

There are several actions that can be carried out on a queue:


Enqueue add new data to the rear of the queue Linear queue A queue in
Dequeue remove one item from the front of the queue which data is stored in a
line.
Peek (or Top) look at, but don’t remove, one item from the front of the queue
IsEmpty check to see if the queue is empty Circular queue A queue
which wraps around in a
IsFull check to see if the queue is full circle. If implemented using
an array, the last index is
The IsFull and IsEmpty actions are necessary because a program will crash
followed by the first index.
if there is an attempt to enqueue data when the queue is already full or to
dequeue data from an empty queue. Priority queue A queue
which stores a priority for
There are three types of queue: each value so that the items
✚ Linear queue with the highest priority can
✚ Circular queue be accessed first.
✚ Priority queue

Implementing a linear queue


In a linear queue a front pointer is not needed.

RP
[0] [1] [2] [3] [4] [5]
Dave Angelina Faaris Kev RP 3

Items are retrieved from the front of the queue by moving each item forward
in the array:

RP
[0] [1] [2] [3] [4] [5]
Angelina Faaris Kev RP 2

This can be inefficient, especially for large queues, as moving each item in the
array takes time. 39

My Revision Notes AQA A-level Computer Science Third Edition


325487_02_MRN_AQA_CS_034-052.indd Page 40 6/29/21 10:01 PM f-0116 /103/HO02206/work/indd

Implementing a circular queue


In a circular queue a front pointer is needed.
The front pointer is moved whenever an item is dequeued:
2 Fundamentals of data structures

FP RP
[0] [1] [2] [3] [4] [5] FP 1
Dave Angelina Faaris Kev RP 3

Note
In a circular queue there is no need to delete the value from the array, only to move
the pointers. The data that has been dequeued will eventually be overwritten when
the rear pointer comes back around.

When a pointer reaches the end of the array, it wraps around back to the start.
For example, given the following state of a circular queue:

FP RP
[0] [1] [2] [3] [4] [5] FP 2
Dave Angelina Faaris Kev RP 5

When a new item is enqueued, the rear pointer will wrap around to 0.

RP FP
[0] [1] [2] [3] [4] [5] FP 2
Aadya Dave Angelina Faaris Kev RP 0

Note
Exact implementations vary slightly, for example some implementations have the rear
pointer pointing to the first empty space rather than the last full space.

A circular queue is much more efficient that a linear queue when the queue is
large as it avoids the need to move each item each time a value is dequeued.
A circular queue is also a more complex data structure and a linear queue
may be more appropriate for a smaller queue.

Implementing a priority queue


A priority queue enqueues items to the rear of the queue, but also records a
priority level.
When an item is enqueued the new item's priority will be compared to each
item in the list, starting at the back, in order to find the correct position to
insert the item. This means that the items with the highest priority will
always be dequeued first.
In the example below, a priority queue is used to store the inputs to a
processing system on an aircraft. The bottom row represents the priority
level, where a higher number means a higher priority.

FP RP
[0] [1] [2] [3] [4] [5]
Engine Steering Calculate
Warning Input Position
5 4 3
40

Check your understanding and progress at www.hoddereducation.co.uk/myrevisionnotesdownloads


325487_02_MRN_AQA_CS_034-052.indd Page 41 6/29/21 10:01 PM f-0116 /103/HO02206/work/indd

A new item, Rudder Input, is added to the queue, with priority 4.


Starting at the rear of the queue, the priority is compared to Calculate
Position. Because the priority is higher, this item is moved back one space.

2 Fundamentals of data structures


The priority is then compared to Steering Input. Because the priority is the
same (or higher), the new item is inserted into the list behind it.

FP RP
[0] [1] [2] [3] [4] [5]
Engine Steering Rudder Calculate
Warning Input Input Position
5 4 4 3

Now test yourself Exam tip

11 What does the acronym FIFO stand for? Questions relating to


queues may focus on
12 What is the meaning of the term enqueue?
hand-tracing algorithms,
13 Suggest two uses for a queue data structure
discussing the
14 Which type of queue will enqueue items in a position based on their importance? circumstances in which
15 What pointers are required for a circular queue? different types of queues
16 Explain why the method IsFull is required when designing a queue data structure. are needed (Section A),
suggesting what changes
Answers available online may be needed to adapt
one type of queue into
another (Section C) or
Revision activity making changes to an
✚ Create a Queue class in your chosen programming language. Include the following existing implementation
methods. (Section D).
✚ IsFull
✚ IsEmpty
✚ Enqueue
✚ Dequeue
✚ Peek
✚ Implement a linear queue, a circular queue and a priority queue.

Stacks
A stack is a Last In, First Out (LIFO) data structure. Stack A data structure in
Much as with a stack of plates, new items are placed at the top of the stack which items are added to
and items are also removed from the top of the stack. the top and removed from
the top, much like a stack of
Common uses for stacks include: plates.
✚ reversing a list of values
Last In, First Out (LIFO)
✚ performing undo operations
Those items placed into the
✚ as a call stack for keeping track of subroutine calls.
stack most recently will be
A stack can be implemented using a single-dimensional array and a single the first ones to be accessed.
integer variable to point at the top of the stack.

[5] Top 2
[4]
[3]
[2] Change font Top
[1] Make bold
[0] Type

41

My Revision Notes AQA A-level Computer Science Third Edition


325487_02_MRN_AQA_CS_034-052.indd Page 42 6/29/21 10:01 PM f-0116 /103/HO02206/work/indd

There are several actions that can be carried out on a queue:


Making links
Push add new data to the top of the stack Stacks are a fundamental
Pop remove one item from the top of the stack part of the depth first search
2 Fundamentals of data structures

(DFS) which is explored in


Peek (or Top) look at, but don’t remove, one item from the top of the stack
Chapter 3.
IsEmpty check to see if the stack is empty
IsFull check to see if the stack is full

The IsFull and IsEmpty actions are necessary because a program will crash if
there is an attempt to push data when the stack is already full or to pop data
from an empty stack.
When a value is pushed onto the stack it is placed at the top position and the
value of the top pointer is incremented.

[5] Top 3
[4]
[3] Delete selection
[2] Change font Top
[1] Make bold
[0] Type

When a value is popped from the stack the value at the top position is
returned and the top pointer is decremented.

[5] Top 2
[4]
[3] Delete selection
[2] Change font Top
[1] Make bold
[0] Type

Now test yourself Note

17 State the acronym used to classify a stack data structure, and state the words this In a stack there is no need
stands for. to delete the value from
18 Describe two potential uses for a stack. the array, only to move the
pointer. The data that has
19 What error could occur when trying to Push an item? State how this situation could
been popped will eventually
be dealt with.
be overwritten when new
20 Describe the difference between Pop and Peek. data is pushed and the top
pointer moves back up.
Answers available online

Revision activity
✚ Create a Stack class in your chosen programming language. Include the following
methods:
✚ IsFull
✚ IsEmpty
✚ Push
✚ Pop
✚ Peek
✚ Take a program that you have written that makes use of subroutines and write down
the state of the call stack each time a new subroutine is called or a value returned.
✚ Repeat the first bullet for a recursive program that you have written.

42

Check your understanding and progress at www.hoddereducation.co.uk/myrevisionnotesdownloads


325487_02_MRN_AQA_CS_034-052.indd Page 43 6/29/21 10:01 PM f-0116 /103/HO02206/work/indd

Graphs
A graph is a data structure designed to represent more complex
Graph A data structure
relationships.

2 Fundamentals of data structures


designed to represent the
Typical uses for graphs include: relationships between items.
✚ route finding Node Used to represent an
✚ representing relationships in human networks (such as in social networks) item of data, drawn as a circle.
✚ computer networks Also known as a vertex.
✚ project management
Edge A line used to
✚ game theory (mathematical modelling of strategic decisions).
represent the relationship
Each graph is made up of nodes (or vertices) and edges (or arcs). between two nodes. Also
known as an arc.
There are several types of graph.

Types of graph
Unweighted and undirected graphs
Town A Town B
A simple graph (unweighted and undirected) shows how two or more items
are connected.
Figure 2.3 An unweighted,
undirected graph
Weighted graphs
A weighted graph is used where the connection between the two nodes has a Weighted graph A graph in
cost or value (such as a distance). which each edge has a value
or cost associated with it.
30
Town A Town B Directed graph A graph
some edges can only be
Figure 2.4 A weighted graph traversed in one direction,
shown with an arrow head.

Directed graphs Disconnected graph A


graph in which two or more
In a directed graph, one or more edges has an arrow which shows that this
nodes are not connected to
edge can only be traversed in one direct.
the rest of the graph.

Charles Pauline
Exam tip
Harry Make sure you can identify
the different types of
graph. Be careful with the
Dave
Jack term ‘edge’. This doesn’t
mean the outskirts of the
graph, but the connections
Figure 2.5 A directed graph
between each node.
In a directed graph, not all edges need to be one-directional.
Now test yourself
Disconnected graphs 21 Explain the following terms.
A disconnected graph is one in which two or more vertices are not connected a Weighted graph
to the rest of the graph. b Directed graph
c Disconnected graph
A B
22 State two other terms
for a line or a connector
E
in a graph.
23 What symbol is only used
C
in a directed graph?
D 24 Suggest two possible uses
for a graph data structure.
Figure 2.6 A disconnected graph Answers available
online 43

My Revision Notes AQA A-level Computer Science Third Edition


325487_02_MRN_AQA_CS_034-052.indd Page 44 6/29/21 10:01 PM f-0116 /103/HO02206/work/indd

Adjacency lists and adjacency matrices


While graphs can be an effective visual way to represent a system for
humans, to store them in a computer system uses one of two methods: an
2 Fundamentals of data structures

adjacency list or adjacency matrix


An adjacency list uses a list for each node to store details of adjacent nodes. Adjacency list A method
Vertex Adjacent vertices of representing a graph
A B by listing, for each node,
A B,C
just the nodes that are
E B A,C,E connected to it directly.
C A,B,D
C D C,E
D
E B,D

Figure 2.7 An adjacency list for an unweighted graph

For a weighted graph, this list also includes the cost of travelling along
each edge.

20 Vertex Adjacent vertices


A B 25
A B,20,C,30
30 E B A,20,C,30,E,25
30
C A,30,B,30,D,35
40
C 35 D C,35,E,40
D
E B,25,D,40

Figure 2.8 An adjacency list for a weighted graph

This is efficient for sparse graphs, where the presence of edges does not need Sparse graph A graph with
to be tested often, because sparse graphs have very few edges and so not few edges.
much storage space is needed. However reading and processing each item in
an adjacency list can be inefficient if the list is large. Adjacency matrix A
method of representing
An adjacency matrix uses a grid to store details of adjacent nodes. a graph using a grid with
For an unweighted graph the adjacency matrix uses a binary number to show values in each cell to show
the presence or lack of an edge. which nodes are connected
to each other.
A B C D E
A B Dense graph A graph with
A 0 1 1 0 0 many edges.
E B 1 0 1 0 1
C 1 1 0 1 0
C D 0 0 1 0 1
D
E 0 1 0 1 0

Figure 2.9 An adjacency matrix for an unweighted, undirected graph

This is efficient for dense graphs, where the presence of edges needs to be
tested often, because the adjacency matrix is simple to step through. However
a lot of space can be wasted if the graph has few edges.
Undirected graphs will produce an adjacency matrix with a diagonal line of
symmetry.
Directed graphs will produce an adjacency matrix without symmetry, as not
all edges can be traversed in either direction.

44

Check your understanding and progress at www.hoddereducation.co.uk/myrevisionnotesdownloads


325487_02_MRN_AQA_CS_034-052.indd Page 45 6/29/21 10:01 PM f-0116 /103/HO02206/work/indd

A B C D E
A B
A 0 1 0 1 0
E B 0 0 0 0 1

2 Fundamentals of data structures


C 0 0 0 0 0
C D 0 0 1 0 1
D
E 0 0 0 0 0

Figure 2.10 An adjacency matrix for a directed graph

Weighted graphs will produce an adjacency matrix that stores the cost of each
edge.
Where nodes are not adjacent the cost of traversing is infinite.

20 A B C D E
A B 25
A ∞ 20 30 ∞ ∞
30 E B 20 ∞ 30 ∞ 25
30 Exam tips
C 30 30 ∞ 35 ∞
40 Make sure you are confident
C 35 D ∞ ∞ 35 ∞ 40 recalling the pros and
D
E ∞ 25 ∞ 40 ∞ cons of adjacency lists and
adjacency matrices, as this
Figure 2.11 An adjacency matrix for a weighted graph is a common question.
The number of edges is the main consideration when deciding whether an The difference between
adjacency list or an adjacency matrix is the most appropriate data structure a graph and a tree is that
for recording the details of a graph. a tree has no cycles. This
question comes up quite
Advantages Disadvantages often.
Adjacency list Good for sparse graphs (few Poor for dense graphs as it
edges) or situations where takes longer to process each
edges don’t need to be tested value.
often as it takes up less
storage space.
Adjacency matrix Good for dense graphs (many Poor for sparse graphs as it
edges) or situations where wastes storage space.
edges do need to be tested
often as it is easier to process
each value.

Now test yourself Revision activity

25 Which representation for a graph, when written down, looks most like a grid? ✚ Create a weighted graph
26 Which representation for a graph is most suitable for a sparse graph? showing the time taken
to travel between five
27 When else would that representation be most suitable?
towns near your home.
28 When would an adjacency matrix not be symmetrical? ✚ Create an adjacency
29 True or false? An adjacency list cannot be used for a weighted graph. matrix and an adjacency
list to represent the
Answers available online graph.

Trees
A tree is a special example of a graph which has no cycles (or loops). Tree A graph which has no
cycles (it is not possible to loop
Trees are always connected (no disconnected nodes) and undirected (edges back around to a previously
can be traversed in both directions). traversed part of the tree).
A rooted tree has one node as the root, or starting point, and all of the edges Rooted tree A tree with a
tend to lead away from the root. Rooted trees are commonly used to represent rooted node, from which all
a hierarchical structure, such as the chapters in this book. They are very edges leading away from
45
commonly used as binary search trees, as described below. that root.

My Revision Notes AQA A-level Computer Science Third Edition


325487_02_MRN_AQA_CS_034-052.indd Page 46 6/29/21 10:01 PM f-0116 /103/HO02206/work/indd

A-level Computer Science 2


1

3
4
2 Fundamentals of data structures

Component 1 Component 2

5
1 2 3 4
Programming Data Structures Algorithms Computation 6

Figure 2.13 A non-rooted tree

Stacks Graphs Trees Cat

Budgie Fish
Rooted Non-rooted

Figure 2.12 A rooted tree to represent chapters and topics in this book Rabbit

A non-rooted tree doesn’t have a clear start point and appears at a glance to
Figure 2.14 A binary search
be more like a graph, though with no cycles.
tree for storing pets in
A binary tree is a rooted tree in which each node has a maximum of two alphabetical order
children.
Cat
Binary trees consist of:

Root the node that is the starting point for the tree Budgie Fish
Branch a node that comes after the root and has one or more children
Leaf a node that does not have any children
Dog Rabbit

Binary search trees are especially useful for storing data in an ordered way
Figure 2.15 A binary search
and can be quickly and easily traversed to provide an ordered list.
tree with the addition of a
When adding data to a binary search tree, each new node is added according node for Dog
to its order.
In the example in Figure 2.14, where pets are stored alphabetically, to insert Binary tree A tree in which
the value Dog we would: each node has a maximum
✚ Compare to the root: Dog comes after Cat so follow the right edge of two children.
✚ Compare to the next node: Dog comes before Fish in the alphabet so we Root A node that has no
follow the left node parent nodes.
✚ If there is no child node in that direction, then we add one:
Branch A node that has a
The order in which the nodes are written will be different depending on the parent node and at least
order in which nodes are added. However the binary search tree will always one child node.
be able to provide a correctly ordered list.
Leaf A node that has no
Note child nodes.
Binary search tree A
Binary trees are also useful for representing equations and can be traversed in such
binary tree used to store
a way as to produce equations in infix notation, Polish notation and reverse Polish
data in order so that it
notation (RPN).
can be quickly and easily
searched.

Now test yourself

30 What is the difference between a graph and a tree?


Making links
31 What is the main feature of a binary tree?
32 Describe two advantages of using a binary search tree to store data. Infix and reverse Polish
notation are explored in
Answers available online Chapter 3.
46

Check your understanding and progress at www.hoddereducation.co.uk/myrevisionnotesdownloads


325487_02_MRN_AQA_CS_034-052.indd Page 47 6/29/21 10:01 PM f-0116 /103/HO02206/work/indd

Hash tables
A hash table is a data structure in which values are found by looking up their
associated key by following a hashing algorithm. Revision activity

2 Fundamentals of data structures


When the data is added to the hash table the hashing algorithm is applied to ✚ Complete a binary
the value in order to generate its key. search tree containing
eight items you can see.
A simple hashing algorithm for an ID number might be to add the digits ✚ Create a new binary
together, divide by 6 and record the remainder. (This is known as modulo 6 search tree containing
division). the same eight items,
For example: but added in a different
order.
ID number 25463 ID number 34255
Sum of digits = 2 + 5 + 4 + 6 + 3 = 20 Sum of digits = 3 + 4 + 2 + 5 + 5 = 19 0
Remainder = 20 % 6 = 2 Remainder = 19 % 6 = 1 1 34255
2 25463
The key can then be used as the index for the value in the hash table.
3
In a large hash table this allows for a value to be found quickly. 4
If the program were to search for the ID number 25463 then it could be run 5
through the hashing algorithm and the index number calculated rather than
having to perform a search. This reduces the search time.
Hash table A data
A problem can occur where two values generate the same key. This is referred structure for holding data
to as a collision. that is indexed according to
its key.
In the event of a collision, a simple solution is to store the value in the next
available index. Hashing algorithm An
algorithm for calculating a
Once a hash table is more than half full there will be many collisions, and so key for each value.
it is wise to rehash the table.
Collision The situation
This involves designing a new hashing algorithm that will provide more where two different items of
possible values (for example, using modulo 20 rather than modulo 6) and re- data produce the same key.
calculating the hashes for each existing value.
Rehashing The process of
Ideally a hashing algorithm should be designed to avoid this problem, recalculating the keys for all
however rehashing might be needed if data storage requirements grow over existing data using a new
the life of a programming project. hashing algorithm.

Making links
Hashing algorithms are also used for checksums (to check the validity of a file or other
piece of data) and for encryption (hashed passwords are typically stored in databases Revision activity
rather than plaintext passwords). Checksums and other error checking processes, and ✚ Design a simple hashing
encryption, are described in Chapter 5. algorithm for storing the
names of films based
on the length of the film
Now test yourself title.
✚ Implement a hash table,
33 Describe the relationship between a value and its key in a hash table. storing the names
34 What is meant by a collision in a hash table? of films in an array
based on the hashed
35 Describe two steps that must be taken when rehashing.
keys. Display an error
36 Describe three potential uses for a hashing algorithm. message if two films
37 A hashing algorithm for an ID number is written as ‘sum of each digit MOD 6’. generate the same key
Calculate the hashes for each of the following values. and devise an improved
a 7216 hashing algorithm to
b 5891 reduce the number of
c 0275 collisions (for example,
alter the modulo
Answers available online division).
47

My Revision Notes AQA A-level Computer Science Third Edition


325487_02_MRN_AQA_CS_034-052.indd Page 48 6/29/21 10:01 PM f-0116 /103/HO02206/work/indd

Dictionaries
A dictionary is a collection of key–value pairs, in which the value is found by
Dictionary A data
looking up the key.
2 Fundamentals of data structures

structure based on key–


Keys must be unique, but values can be duplicated. value pairs.

One use for a dictionary is information retrieval, for example in frequency Frequency analysis The
analysis (storing the value of how many instances of a word, letter or other process of examining how
key appears) or as a high score table: often something occurs.
A useful tool for trying to
{"Dave" : 23, "Kev" : 37, "Angelina" : 42} break some encryption
Another use for a dictionary is lossless compression where a dictionary of methods.
values is stored and the original file is represented with just the keys, in order. Lossless compression
For instance using the following dictionary: Reducing the size of a file
without the loss of any data.
Key Value
1 ask
2 not
3 what
4 your
5 country
6 can
7 do
8 for
9 you
10 ,
11 .
We can compress the sentence:
"Ask not what your country can do for you, ask what you can
do for your country."
This sentence can be stored as:

1 2 3 4 5 6 7 8 9 10 1 3 6 7 8 4 5 12

Now test yourself

38 Describe the essential concept of a dictionary using exactly three words.


39 Identify which field is which in a dictionary designed to store data for frequency
analysis.
40 Identify which field is which in a dictionary designed to store what type of food
each dog staying at a kennels should be fed with.

Answers available online

Vectors
Vector representation
In mathematics, scalars are simple numbers that only have a size. Vectors on Scalar A single number
the other hand are numbers that have both a magnitude and a direction. used to represent or adjust
Vectors are often used to represent a position. For example, a 2D vector can be the scale of a vector.
used to can be represent a position on a 2D plane. Vector A data structure
used to represent a position
Vectors can be shown in the list representation – when it is represented (for example, a 2D vector
as a list of numbers, such as [3,5]. In this two-dimensional vector the
48 represents a position on a 2D
plane).

Check your understanding and progress at www.hoddereducation.co.uk/myrevisionnotesdownloads


Another Random Scribd Document
with Unrelated Content
He knew so many instances of transactions like that which he had
stated, that he doubted not the greater part of the certificates had
been obtained by similar means. Indeed he could not conceive any
other by which they could be obtained.
He said we were, perhaps, without a precedent in any other nation
which would be strictly applicable; but he desired gentlemen to
determine for themselves, whether, under such circumstances, the
man who had rendered services to his country should be deprived of
his reward, or whether the purchaser ought to receive it. He said it
was very different in the common transactions of life. If a man
purchased a tract of land for £1,000, paid the money, and took a
bond for the conveyance, a third person, by informing the purchaser
that the seller could not make a title, or by other false suggestions
should obtain a transfer of the bond in consideration of £100, and
get a conveyance and possession of the land, yet, on repaying the
£100, the conveyance would be set aside, and he would be restored
to his land.
He gave some other instances of a similar nature, and said, he
believed, if a bond, whether due, or to become due, was assigned
under such circumstances, that the obligee would be justifiable in
contesting it in a court of law, and that the injured person would, on
application, obtain redress. He said, that in cases of extreme
hardship, Courts of Equity would give relief without express proof of
fraud; that this was the law of Great Britain, and was agreeable to
the principles of the civil law; that the Roman jurists, he believed,
had fixed the point of extreme hardship to one half of the value of
the property transferred; in England the court was to judge.
He said he did not think the present holders were strictly entitled to
any thing more than the original purchasers; that here the maxim,
quoted on the other side of the question, that the assignee stands in
the shoes of the assignor, properly applied. You cannot place
another on more advantageous ground than that on which you stand
yourself. The plea of an innocent purchaser could not take place; the
nature of the transaction must appear evident to every man
concerned in the transfer.
He said the reverse of this did not hold. An assignee was not always
in as advantageous a situation as the assignor; and instanced the
case of an executor who should obtain the assignment of his
testator's bond at an undervalue; and who, he said, could not retain
in his hands the amount of the sum specified in the bond, which the
creditor might have recovered, but only the sum which he actually
paid for the bond.
He said, that, though in his opinion the present holders of
certificates were strictly entitled to no more than what had been
paid to the original holders, yet, as an investigation of that
circumstance would be involved in inextricable difficulties, and since
we were (as had been very properly observed and well expressed by
a gentleman from South Carolina) settling the business of a family,
he was willing to acquiesce in the motion of his colleague. He said,
that arbitrators often gave the injured party less than his due, for
peace sake; and he was willing to act on the same principle. He
doubted not but courts of justice would give relief in particular
cases; but in a matter of that magnitude, he thought the
interference of the Legislature very proper. The South Sea business,
he thought, in that respect, a good precedent. Two gentlemen had
mentioned the business; he would not say they had misstated the
transaction, but he thought their accounts imperfect. They said they
had the documents under their hands; he wished they had been
read; he had them not, but would state from memory what he
thought applicable to the case in question. The directors of the
South Sea Company, by various arts, induced the people to give as
high as £1,000 for £100 stock; in many instances the money was
paid, in others it was contracted to be paid. A gentleman has said,
that Parliament interfered, not to violate, but to perfect the contract:
but what did Parliament do? They confiscated the estates of the
directors, and applied the amount to the relief of those who had
actually paid their money, and suspended suits against those who
had not paid; and authorized the debtors to discharge their debts by
the payment of ten per cent. on the real value of the stock
subscribed for. But if he was wrong in supposing the present holders
ought to stand in the place of the first purchasers, they could be
considered only as having purchased, in market, a paper of
indefinite value; if, then, they get the highest market price, they are
not injured.
He would now endeavor to obviate some of the objections to the
measure, on account of its impracticability; and in general terms
observed, that much greater pains had been taken to show the
impracticability than the injustice of it. He said, if it was just, we
ought to adopt it; and he did not doubt but the wisdom of the
Legislature would be able to carry it into effect. Purchasers, he said,
had been represented as the supporters of public credit; but he
could not consider them in that light. The offering a tenth or an
eighth part of the value of the bond of an individual would tend
rather to blast his credit than to support it; it would have the same
effect with respect to the public.
He said he had lived long enough to be convinced that wise and
great men, having the same object in view, often differ in opinion
with respect to the means of accomplishing it; therefore, every
proposition ought to be treated with candor and respect. He made
that observation in consequence of what passed yesterday. A
gentleman from Massachusetts had introduced his speech in a
manner somewhat new—with an apology for an impropriety which
he intended to commit. He pursued the arguments of those who
went before him, in opposition to the amendment; but his speech
consisted principally in an effusion of opprobrious epithets, some of
which he repeated, and said, to detail the whole would perhaps fill
half a column of a newspaper. He said he felt, on the occasion, not
for himself, for he had not expressed his sentiments on the subject
under debate, but for the honor of the House, in which, he thought,
no such language ought to be used.
It had been said we came forward as volunteers; that the original
holders did not put in their claim. That might be easily accounted
for; they were generally obscure and indigent; had too much
modesty, or perhaps not the capacity, to come forward. That he
believed the crowd in the gallery did not consist of original holders.
Mr. Hartley.—I do not wish to trespass upon the time of the
committee, but I cannot consent to give a silent vote on this
occasion. I mean, however, to confine myself to a few observations,
as many of my ideas have been communicated by other gentlemen.
The honorable gentleman from South Carolina (Mr. Smith) has
anticipated much of what I had to urge; I shall therefore reduce my
view of the subject to two points; first, as to the justice or legality of
the measure, in obliging a creditor, or assignee, to take less than a
certificate expresses, and pay the difference to another: second, as
to the practicability or policy of the motion and its consequences.
As to making further satisfaction to the officers and soldiers of the
late army, who have sold their certificates for an inconsiderable sum,
and who have in consequence reaped a less reward than the
Government contracted for, and intended them, I conceive it has
nothing to do with the present question. However, if there is a
disposition in Congress to make a further compensation to those
brave and meritorious men, I would be among the first to support
the measure; but I think this a subject too momentous to be
involved collaterally in the question now under consideration.
With respect to the first point that offers itself, I have to remark,
that a man who enters into a contract should know the
consideration, and understand the principles upon which it is made,
and these should be expressed on the face of the evidence of the
contract. Now, if this contract be of a negotiable nature, the person
to whom the same is offered, looks on its face, from which it
discovers the agrementum, and is naturally led to consider the
circumstances of the debtor, his ability and integrity. Suppose even
the evidence of the contract to be obtained by fraud, unless it be
against the express provision of a statute, and is transferred to a
third person for a valuable consideration, without notice of fraud, it,
must be paid. A fraud in any link of the chain is corrected by a bona
fide transfer for a valuable consideration, without a knowledge of
that circumstance by the purchaser.
Now, let us apply these principles to the present case. Here is an
instrument of writing, specifying a debt to be due from the United
States to the original holder, or bearer; this being brought into
market, is offered to a third person, he, before his purchase, sees
that the contract was executed in consequence of a consideration,
and not against any positive statute; he then inquires the ability of
the Union, and its disposition to comply with the contract; and, from
a consideration of these circumstances, he concludes, with respect
to his own interest and safety in the purchase, and pays what is
conceived to be the value. What is there to discharge the
Government from the payment? Is it pretended that the services and
supplies were an inadequate compensation? If it even was so
supposed, it would not authorize us to refuse a compliance with our
engagements; any interference would set afloat the great principle
upon which the public tranquillity and happiness depend. This leads
me to consider the subject in my second point of view, with respect
to its policy and practicability, and the consequences that would
result from the attempt.
There are but few original holders who have transferred, that can be
found; of consequence, you would throw the major part of the debt
into an intricate labyrinth. The present possessor would be shifting
back the certificate to the original holder, as far as a latitude is
given. Many persons who were bare trustees, would be reaping
advantages, and drawing money from the Public Treasury, to which
they are not entitled; oaths would be multiplied on oaths; perjuries
on perjuries; fraud upon fraud; and every species of speculation
would ensue; deception would be a strong trait in the character of
the times, and the whole of the United States would be in motion,
each endeavoring to prey upon the other. The consequences of a
second inundation of this nature are to be dreaded, and ought to be
carefully avoided.
Mr. Moore observed, that it was agreed on all hands, and proposed in
the report of the Secretary, that some discrimination ought to take
place. It was, therefore, incumbent on the House to inquire how this
might be effected with the greatest degree of equity. He supposed
the result would be, that we are at liberty to pay the most
meritorious first. Who constituted this class of citizens? He trusted
the late army had an incontrovertible title to it. He could never
believe that the men who stripped the soldiers of their hard
earnings, by allowing them a tenth of their claim, would have the
temerity to pretend that they had acquired the title of merit with
their money, and that the soldier relinquished, with his certificate,
the honor of his corps.
Had the present question been agitated in the hour of distress, when
an army was essential to our defence, the arguments of justice and
equity would have had their weight. Perhaps it is the soldier's
misfortune, that the question arises at a time when the object for
which he was employed is secured. But notwithstanding all that has
been said, I am fully convinced that his claim is insuperable in
equity. The soldier did not engage to fight your battles to be
compensated with a certificate, acknowledging you were indebted to
him; it was specie you promised, and specie he had a right to
expect, or something equal to it in reality. The public faith was
actually pledged to him for a compensation for his services; but will
any one say the public faith was inviolably kept with him, when a
certificate, worth but two shillings in the pound was forced upon him
as specie? The poor soldier, thus situated, was followed by gangs of
speculators, who endeavored to impose on his judgment by the
relation of artful and insidious opinions of the public capacity and
integrity in the discharge of these acknowledgments. The soldier,
incapable of detecting the specious falsehood, swallows the bait, and
becomes the easy prey of designing men. The people felt and
resented the injuries thus perpetrated on those they esteemed; and
I am much mistaken if the citizens of America do not still retain
favorable impressions of the soldiers' services.
A great deal has been said, with respect to public opinion on this
question. It is impossible, perhaps, to ascertain the public mind with
precision; but there is but one way in our power, that is, to suffer
the subject to be suspended for the present session, and on our
return, or the election of our successors, the public sentiment in this
respect will be evinced; but if we are to determine the public mind
from our own observation, I should not hesitate to say that nine out
of ten would be in favor of a discrimination. The people would, on
this principle, I conceive, submit cheerfully to the payment of those
taxes which are requisite to discharge the public engagements; but if
they are to flow into the large cities, or into the hands of foreigners,
who have speculated upon the misfortunes of the most meritorious
class of our citizens, they will bear the burthen with murmurs and
complaints.
Can any principle of justice demand the payment of the present
possessor of a certificate, that does not apply more forcibly as it
respects original holders? Will gentlemen, then, comply with the one,
and neglect the other? Or rather, as my colleague has proposed, if
they are incapable to pay both, will they not prefer a composition?
Mr. Wadsworth.—It appears to me that we have mistaken this
business from the beginning, for we are proceeding as if it was
taken for granted that all those who had alienated their certificates,
have been compelled to it by necessity; there is nothing further from
the truth. So far as it respects the army debt it may be just; and at
this moment, were a soldiery to be paid in certificates, they would
part with them at as great a discount as ever. There is a disposition
in soldiers generally to despise pecuniary considerations; if they
want money, they will dispose of their property at an inconsiderate
value to obtain it. But this remark does not extend to the industrious
part of the public creditors, because they have carefully retained the
evidences of their debt, and now will receive its value. But even of
the army, it is not true that they will suffer the loss of the discount at
which their certificates have been sold. Having an opportunity of
being well acquainted with the circumstances of the army, I know
that many of the officers lived upon their friends, who supported
them from time to time, with such sums as they had occasion for,
and when they retired from the army, they repaid their friends with
the certificates which they had received. The best way for gentlemen
to ascertain the amount of the public debt which has been
transferred from necessity, is to mix in the world, and try, from the
circle of their acquaintance, to learn what the actual transfers have
been. I have done this, and am conscious within myself, that seven-
eighths of all the alienated debt has not been disposed of by the
original holder from necessity.
When the requisitions of Congress were rejected by the State
Assemblies, some of the most wealthy persons of the community,
and those most violently opposed to Continental measures, seemed
to concur in the opinion, that the States would never raise a revenue
for the purpose of paying the domestic debt. The people finding this
a prevailing opinion, were impressed with a dread of its
consequences, and sold this species of negotiable property at a rate
dictated by their apprehensions. I should conceive it as a great evil,
if the Government were now to restore to such persons what they
lost for want of confidence. I think this circumstance will operate
considerably against the gentleman's principle of equity; now, as to
the practicability of the measure, those gentlemen who are
acquainted with the history of the manner in which the public debt
was contracted, will readily agree with me, that it is an insuperable
objection. In the years 1776 and 1777, very few advances were
made to those who procured supplies to the public; they purchased
what they got generally upon credit, and they were obliged, before
their accounts could be settled, and they could get their money from
the Public Treasury, to get receipts for all the articles they had
furnished, and then they received orders upon the loan-officers,
who, not having money, paid them in certificates, which these
people, in return, paid over to those who furnished them with
supplies. So that the agent appears a creditor to a very considerable
amount, when his personal claim is very trifling, and those who
risked their property, without pay of any kind, and who are
undoubtedly deserving of some credit, appeared to be no other than
speculators in public securities. I cannot see, in this case, any
possible mode of discrimination. There are a variety of other official
transactions which would demonstrate the impracticability, if it was
necessary to oppose the proposition on that ground.

Wednesday, February 17.

Public Credit.
The House again went into a committee on the report of the
Secretary of the Treasury, Mr. Baldwin in the chair.
Mr. Madison's proposition still under consideration.
Mr. Page.—I do not wish to trouble the committee with a formal
argument in favor of the motion offered by my colleague; but I wish
to inquire of the gentlemen in opposition, whether they conceive the
principles upon which it is grounded to be unjust? I observed, that
their replies have generally gone against the practicability of the
measure; but that does not prove to me that it is inequitable. If
there is justice in the case, we must not consider the difficulty of the
attempt. I trust, if it shall be found to stand on the foundation of
immutable justice, that its practicability will be demonstrated.
However, I shall not enter on that ground, but leave it to my
colleague, who has so ably supported it on the other.
I would, however, beg gentlemen to answer these questions, and
show to my mind the injustice of the United States complying with
their engagements made to the first holders of certificates, as far as
the case, and their abilities, will permit. Or where is the justice of
doing more for the assignee than he, or his assignor, expected could
or would be done? Where is the breach of faith in Government, if it
pays its whole debt, with a justice, blended with mercy, resembling
that of Heaven itself, making impartial retribution among the
children of men, on the great day of accounts? Where is the
propriety of branding a measure of this nature with epithets of
infamy? or using such harsh expressions as have issued like a torrent
from a gentleman on the other side of the House? So far am I from
viewing the propositions through such a discolored medium, that I
am induced to believe, if Congress adopt it, they may submit its
rectitude, and stand the decision, of not only a superior order of
beings, but of the Great Judge of the Universe, who is immutable
truth itself.
What will the assignee lose by the measure? He will lose nothing,
but the sanguine expectation lately raised in his mind.
Where is the interference in contracts, when the proposition is to
comply sacredly, as far as the case will admit, with the contract
between the State and its creditors? Is not the assignment of the
certificates confirmed by the nation? Does it not give to the assignee
the very thing stipulated between the assignor and assignee, that is,
whatever sum the Government shall be pleased to pay for the
certificate? And is not the sum now proposed, more than either the
first or last assignee ever contemplated, till within a few days past,
would ever be paid him?
The time is now arrived when justice ought to be done; it is looked
for, with anxious expectation, by all classes of our fellow citizens; it
will not avail us to say, it is impracticable, until experience has
demonstrated it to be so. But the measure we contend for is termed
an ex post facto law, and as such, is declared to be unconstitutional.
Gentlemen torture every thing, in order to produce evidence against
an act of justice. How can it be such an ex post facto law as is
prescribed by the constitution, when that expression is conjunctive
with a bill of attainder? It relates to that only, and can have no
reference to the subject of the proposition before us. The same idea,
which prevents us from an interference on the present occasion, will
prevent us, as was observed by the gentleman from Georgia, from
making a statute of limitation, or from correcting any frauds, which
have been perpetrated on the unsuspicious soldiery. We must not
contemplate the restoration of the starving soldier, with his humble
wife and numerous and naked offspring, to a more eligible situation;
we must not restore confidence to the man of honor who is buried in
abject poverty, because it is addressing a language to the heart,
which the haughtiness of the head disdains to hear; but, in doubtful
cases of justice, the heart is the best director on this subject; happy
will it be for us, if, as I think, they both concur to give their
approbation to the present measure.

Thursday, February 18.

Public Credit.
The House again went into a committee on the Secretary of the
Treasury's report, Mr. Baldwin in the chair.
Mr. Madison's proposition still under consideration.
Mr. Stone.—I shall not attempt to show the importance of the subject
before us, as it relates to public credit; or as it will affect our
character as a nation, at home and abroad. These have been
explained; but it is proper for us to consider how far the amendment
may operate to establish a precedent of Continental and State
Legislation, the influence it may have on society, and the rules of
civil conduct between man and man. Every community must
experience that the conduct of the Government will influence the
opinions of the individuals; and the spirit of the individual will
transfuse itself into the Government. This action and reaction
operates more powerfully in a Republican Government, founded on
representation, than on any other.
Our situation is made more important, on the present occasion, by a
disagreement on principles which ought to be fixed and plain; to me
it seems that we differ on the principle of public justice. This may be
unfortunate—let us endeavor to be reconciled. If the true distinction
between natural and civil justice be accurately drawn, we may
annihilate the point in contest. Agreeably to the principle of natural
justice, no contract is perfect unless there be an equivalent; and that
which we call a valuable consideration, on which to ground a
contract, is founded on the idea of an equivalent, and presupposes
it. And, I believe the idea of such a consideration being an
equivalent, is the foundation of the validity of a contract, even in the
English law; and is always carried into effect, wherever the execution
is safe and certain; because I think, whenever it appears in any
court of justice, that the consideration was not an equivalent, that
then the contract is not carried into execution. The execution of the
principle of natural justice then is safe; for instance, £99 19s. 11d. is
not a consideration for £100, but a small sum may be a
consideration for a valuable property; this does not arise from an
infraction of the principle; but because the property may not have a
determinate value in the society; and it would make judges arbitrary,
legal proceedings extremely expensive, and contracts uncertain, if an
extensive discretion as to the value was admitted. But whenever the
consideration is so small and inadequate, as to appear so plainly and
satisfactorily that the judge cannot be mistaken in determining it not
to be an equivalent, there the contract is not valid.
Now, if we have received services from the soldier, and have given
him paper, the question will be, whether that was an equivalent, and
the paper a proper payment; or whether it is only an evidence of the
debt? I take it to be a granted point that it was not a payment, but
an obligation to pay whenever the United States should be able. It
appears to me, then, that it was the duty of the person who received
the paper, to wait a reasonable time; and the duty of the nation to
make actual payment as speedily as possible. If the person who had
received this paper had wantonly parted with it for nothing, I agree
we should have been under no more obligation to pay him the
expressed sum, than if we had paid him money, and he had flung it
away or wasted it; but if, on the contrary, there was a delay in the
execution of the contract, on the part of the Government, which
compelled him to part with it, a compensation is equitable.
The same rule will apply between the original holder, or person who
rendered the service, and present possessor or assignee; for
shortness we will distinguish them by the names of soldier and
speculator. The speculator, when he dealt with the soldier, must,
from the nature of the thing, have induced him to believe that he
gave him an equivalent for his purchase; and it might have been an
inducement to the soldier to sell, to think he had something more
than an equivalent; the speculator thought he had more than an
equivalent, throwing necessity on the one side, and fraud on the
other, out of the question. Then the confidence was equal, perhaps
not a penny between them: I can hardly conceive the exchange took
place on any other terms. You never can allow the confidence of the
speculator to be estimated very highly, perhaps at not more than
one for ten. For if it is admitted, that the speculator had entire
confidence, he was guilty of a palpable fraud, and a violation of the
first principle of justice; it amounted to this, that he gave £10 in
money for £100 bond, which he was certain would be paid. I
believe, if the case stood exactly in this form, no man would hesitate
in deciding its illegality. If a man takes £100 for £10, it is illegal; but
suppose there was a risk, and this risk was considered by the
speculator as little less than ten for one, has he not discovered his
own mistake when he sees he gets an interest of sixty per cent. on
his capital; and that capital tenfold? This contract then ought to be
void on the principle of a mistake; and here you place the speculator
between Scylla and Charybdis. If he really thought the certificates
only worth one for ten, you can give him no credit for his
confidence; and you will admit that he ought to be satisfied with a
reasonable advance on his purchase. But if you give him entire credit
for his confidence in Government, you must give him no credit for
his honesty. If both parties had known of this event, the contract
would never have taken place. If you pay the whole sum, the
speculator ought to take no more than what he gave a fair
equivalent for. Gentlemen who seem afraid of giving to the soldier a
part of his original claim, lest they affront his nobleness of soul,
make no scruple to offer the speculator ten times the sum he is
entitled to, on the principle of natural justice, without any
apprehension that his honor will receive a wound. If the claim of the
soldier was extinguished by receiving two shillings in the pound of
the speculator, upon what principle is it contended that the latter
should receive more than distributive justice? Arguments, proving
that the justice due to the first has been satisfied by what has been
done, apply with greater force to the latter.
It has been doubted, and a question has been agitated, whether we
shall exercise the power of reconsidering these contracts, and
whether a modification is constitutionally in our power? I will not go
into this subject, or any other which ought to be taken for granted. I
shall take it, that we are authorized, and do mean to interfere; you
must act. Do you mean to pay the principal and interest now due? I
believe not. Will you shelter yourself under the plea of necessity?
That is impossible. I dare say, if the United States were sold, they
would at least be worth six hundred millions of dollars; and we have
but eighty millions to provide for. Having, then, the means and
power, I trust you mean to exercise them; and as you exercise them,
you ought to exercise them as justly as possible; then, to do this,
you will, it is said, personify the three parties concerned—the United
States, the original holder, and the speculator. I do not clearly
comprehend the idea of a personified State; perhaps it arises from
my dulness of apprehension. Man, in his natural capacity, is
sometimes obliged to do what is considered unjust; but a State,
when it has power, is not obliged to do what is unjust. The State,
then, in this respect, is doing what an honest man would do, if he
had the power of conducting this business as he thought proper.
The speculator comes to you with his bond, and tells you it is due.
The soldier tells you that he has done services to a considerable
amount, for which he never has been paid; and that those evidences
of the demand which you gave to him, were obtained from him, for
one-tenth part of what they were declared to be worth. The State
says to the speculator, you have made a great deal, and out of a
man who has risked his life, and borne every burthen which human
nature could bear, with the greatest fortitude which the most
virtuous heart is capable of exerting, let him have a part back. The
speculator answers no; here is your bond. Consider again, replies
the State, that the veteran's services, at the expense of his health
and property, at the risk of his life, has saved you and yours; and
not only that, but he is obliged to pay of your demand, more than he
has ever received. What is now his answer? Here is the bond, pay
me my bond. Under these circumstances, supposing the State an
individual, he might, without much infamy to his character, exercise
the power which he has over his own bond, in order to do justice
between the parties. He might say to the speculator, you had the
soldier in your power; you did him injustice; we have you now in our
power, we will do you complete justice, but no more. A private man
could never be injured in his reputation by such conduct: indeed,
according to the result of these circumstances, the hardships of war,
and the breach of contract, have unfortunately inflicted upon the
man, the most meritorious in this community, or perhaps in any
other community, sufferings and miseries—a punishment sufficient
to atone for the guilt of the greatest crimes. This, in the event,
appears to be the situation of the saviors of America.
Mr. Madison said that the opponents of his proposition had imposed
on its friends not only a heavy task, by the number of their
objections, but a delicate one by the nature of some of them. It had
been arranged as an embarrassing measure which ought to be
facilitated, and producing discussions which might end in
disagreeable consequences. However painful it might be to
contradict the wishes of gentlemen whom he respected, he could
promise nothing more, in the present case, than his endeavors to
disappoint their apprehensions. When his judgment could not yield
to the propositions of others, the right to make and support his own,
was a right which he could never suffer to be contested. In
exercising it, he should study to maintain that moderation and
liberality which were due to the greatness of the subject before the
committee. He felt pleasure in acknowledging, that the like spirit
had, in general, directed the arguments on the other side. Free
discussions thus conducted are not only favorable to a right decision,
but to a cheerful acquiescence of the mistaken opponents of it. They
might have the further advantage of recommending the result to the
public, by fully explaining the grounds of it. If the pretensions of a
numerous and meritorious class of citizens be not well founded, or
cannot be complied with, let them see that this is the case, and be
soothed, under their disappointment, with the proof that they have
not been overlooked by their country.
He would proceed now to review the grounds on which the
proposition had been combated; which he should do without either
following those who had wandered from the field of fair argument,
or avoiding those who had kept within its limits.
It could not have escaped the committee, that the gentlemen to
whom he was opposed, had reasoned on this momentous question
as on an ordinary case in a court of law; that they had equally
strained all the maxims that could favor the purchasing, or be
adverse to the original holder; and that they dwelt with equal
pleasure on every circumstance which could brighten the pretensions
of the former, or discredit those of the latter. He had not himself
attempted, nor did he mean to undervalue the pretensions of the
actual holders. In stating them, he had even used as strong terms as
they themselves could have dictated; but beyond a certain point he
could not go. He must renounce every sentiment which he had
hitherto cherished, before his complaisance could admit that America
ought to erect the monuments of her gratitude, not to those who
saved her liberties, but to those who had enriched themselves in her
funds.
All that he wished was, that the claims of the original holders, not
less than those of the actual holders, should be fairly examined and
justly decided. They had been invalidated by nothing yet urged. A
debt was fairly contracted; according to justice and good faith, it
ought to have been paid in gold or silver; a piece of paper only was
substituted. Was this paper equal in value to gold or silver? No. It
was worth, in the market, which the argument for the purchasing
holders makes the criterion, no more than one-eighth or one-
seventh of that value. Was this depreciated paper freely accepted?
No. The Government offered that or nothing. The relation of the
individual to the Government, and the circumstances of the offer,
rendered the acceptance a forced, not a free one. The same degree
of constraint would vitiate a transaction between man and man,
before any Court of Equity on the face of the earth. There are even
cases where consent cannot be pretended; where the property of
the planter or farmer had been taken at the point of the bayonet,
and a certificate presented in the same manner. But why did the
creditors part with their acknowledgment of the debt? In some
instances, from necessity; in others, from a well-founded distrust of
the public. Whether from the one, or the other, they had been
injured; they had suffered loss, through the default of the debtor;
and the debtor cannot, in justice or honor, take advantage of the
default.
Here, then, was a debt acknowledged to have been once due, and
which was never discharged; because the payment was forced and
defective. The balance, consequently, is still due, and is of as sacred
a nature as the claims of the purchasing holder can be; and if both
are not to be paid in the whole, is equally entitled to payment in
part.
He begged gentlemen would not yield too readily to the artificial
niceties of forensic reasoning; that they would consider not the
form, but the substance—not the letter, but the equity—not the bark,
but the pith of the business. It was a great and an extraordinary
case; it ought to be decided on the great and fundamental principles
of justice. He had been animadverted upon, for appealing to the
heart as well as the head; he would be bold, nevertheless, to repeat,
that, in great and unusual questions of morality, the heart is the best
judge.
It had been said, by a member from Massachusetts, that the
proposition was founded on a new principle in Congress. If the
present Congress be meant, that is not strange, for Congress itself is
new; if the former Congress be meant, it is not true, for the principle
is found in an act which had been already cited. After the pay of the
army had, during the war, been nominally and legally discharged in
depreciated paper, the loss was made up to the sufferers.
It had been said, by a member from New York, that this case was
not parallel, there being no third party like the present holders of
certificates. This objection could not be valid. The Government paid
ten dollars' worth in fact, but only one to the soldier. The soldier was
then the original holder. The soldier assigned it to the citizen; the
citizen then became the actual holder. What was the event? The loss
of the original holder was repaired, after the actual holder had been
settled with, according to the highest market value of his paper.
He did not mean, however, to decide on the whole merits of this last
transaction; or to contend for a similitude, in all respects, between
the two kinds of paper. One material difference was, that the bills of
credit, by more frequent transfers, and by dividing the change of
value among a greater number of hands, rendered the effect of less
consequence to individuals, and less sensible to the public mind. But
this difference, whatever force it might give to the claims of the
purchasing holder of certificates, could diminish nothing from the
claims of the original holders who assigned them.
It had been said, by another member from Massachusetts, that the
old Government did every thing in its power. It made requisitions,
used exhortations, and in every respect discharged its duty; but it
was to be remembered, that the debt was not due from the
Government, but the United States. An attorney, with full powers to
form, without the means to fulfil engagements, could never, by his
ineffectual, though honest efforts, exonerate his principal.
He had been repeatedly reminded of the address of Congress in
1783, which rejected a discrimination between original and
purchasing holders. At that period, the certificates to the army, and
citizens at large, had not been issued. The transfers were confined
to loan-office certificates, were not numerous, and had been, in
great part, made with little loss to the original creditor. At present,
the transfers extend to a vast proportion of the whole debt, and the
loss to the original holders has been immense. The injustice which
has taken place has been enormous and flagrant, and makes redress
a great national object. This change of circumstances destroys the
argument from the act of Congress referred to; but if implicit regard
is to be paid to the doctrines of that act, any modification of the
interest of the debt will be as inadmissible as a modification of the
principal.
It had been said, that if the losses of the original creditors are
entitled to reparation, Congress ought to repair those suffered from
paper money—from the ravages of the war, and from the act of
barring claims not produced within a limited time. As to the paper
money, either the case is applicable, or it is not: if not applicable, the
argument fails; if applicable, either the depreciated certificates ought
to be liquidated by a like scale, as was applied to the depreciated
money; or the money, even if the whole mass of it was still in
circulation, ought to be literally redeemed, like the certificates.
Leaving the gentleman to make his own choice of these dilemmas,
he would only add, himself, that if there were no other difference
between the cases, the manifest impossibility of redressing the one,
and the practicability of redressing the other, was a sufficient answer
to the objection. With respect to the towns burnt, and other
devastations of war, it was taught, by the writers on the law of
nations, that they were to be numbered among the inevitable
calamities of mankind. Still, however, a Government owed them
every alleviation which it could conveniently afford; but no authority
could be found that puts on the same footing with those calamities,
such as proceed from a failure to fulfil the direct and express
obligations of the public. The just claims barred by the act of
limitation, were, in his opinion, clearly entitled to redress. That act
was highly objectionable. The public, which was interested in
shortening the term, undertook to decide, that no claim, however
just, should be admitted, if not presented within nine months. The
act made none of the exceptions usual in such acts, not even in
favor of the most distant parts of the Union. In many instances, it
had been absolutely impossible for the persons injured to know of
the regulation. Some of these instances were within his own
knowledge. To limit the duration of a law to a period, within which it
could not possibly be promulged, and then take advantage of the
impossibility, would be imitating the Roman tyrant, who posted up
his edicts so high that they could not be read, and then punished the
people for not obeying them.
It has been said, that if the purchased certificates were funded at
the rate proposed, they would fall in the market, and the holders be
injured. It was pretty certain, that the greater part, at least, would
be gainers. He believed that the highest market price, especially with
the arrears of interest incorporated, well funded at six per cent,
would prevent every loss that could justify complaint.
But foreigners had become purchasers, and ought to be particularly
respected. Foreigners, he remarked, had themselves made a
difference between the value of the foreign and domestic debt; they
would, therefore, the less complain of a difference made by
Government here. It was his opinion that the term stated in the
proposition would yield a greater profit to the foreign purchasers
than they could have got for their money if advanced by them in any
of the funds of Europe.
The proposition had been charged with robbing one set of men to
pay another. If there were robbery in the case, it had been
committed on the original creditors. But, to speak more accurately,
as well as more moderately, the proposition would do no more than
withhold a part from each of two creditors, where both were not to
be paid the whole.
A member from New York has asked whether an original creditor,
who had assigned his certificate, could, in conscience, accept a
reimbursement in the manner proposed? He would not deny that
assignments might have been made with such explanations, or
under such circumstances, as would have that effect; but, in
general, the assignments have been made with reference merely to
the market value, and the uncertainty of the steps that might be
taken by the Government. The bulk of the creditors had assigned
under circumstances from which no scruples could arise. In all cases
where a scruple existed, the benefit of the provision might be
renounced. He would, in turn, ask the gentleman, whether there
was not more room to apprehend that the present holder, who had
got his certificate of a distressed and meritorious fellow-citizen for
one-eighth or one-tenth its ultimate value, might not feel some
remorse in retaining so unconscionable an advantage?
Similar propositions, it was said, had been made and rejected in the
State Legislatures. This was not a fact. The propositions made in the
State Legislatures were not intended to do justice to the injured, but
to seize a profit to the public.
But no petitions for redress had come from the sufferers. Was merit,
then, to be the less regarded, because it was modest? Perhaps,
however, another explanation ought to be given. Many of the
sufferers were poor and uninformed. Those of another description
were so dispersed, that their interests and efforts could not be
brought forward. The case of the purchasing holders was very
different.
The constitutionality of the proposition had been drawn into
question. He asked whether words could be devised that would
place the new Government more precisely in the same relation to
the real creditors with the old? The power was the same; the
obligation was the same. The means only were varied.
An objection had been drawn from the article prohibiting ex post
facto laws. But as ex post facto laws relate to criminal, not civil
cases, the constitution itself requires this definition, by adding to a
like restriction on the States an express one against retrospective
laws of a civil nature.
It had been said, that foreigners had been led to purchase, by their
faith in the article of the constitution relating to the public debts. He
would answer this objection by a single fact: Foreigners had shown,
by the market price in Europe, that they trusted the nature of
foreign debt more under the old Government, than the nature of the
domestic debt under the new Government.
Objections to the measure had been drawn from its supposed
tendency to impede public credit. He thought it, on the contrary,
perfectly consistent with the establishment of public credit. It was in
vain to say, that Government ought never to revise measures once
decided. Great caution on this head ought, no doubt, to be
observed; but there were situations in which, without some
legislative interposition, the first principles of justice, and the very
ends of civil society, would be frustrated. The gentlemen themselves
had been compelled to make exceptions to the general doctrine;
they would probably make more before the business was at an end.
It had been urged, that if Government should interpose in the
present case, as interposition would be authorized in any case
whatever where the stock might fluctuate, the principle would apply
as well to a fall of sixty or seventy per cent. as to a fall of six
hundred or seven hundred per cent. He could not admit this
inference. A distinction was essential between an extreme case, and
a case short of it. The line was difficult to be drawn; but it was no
more incumbent on him than on his opponents to draw it. They
themselves could not deny that a certain extremity of the evil would
have justified the interposition. Suppose that the distress of the
alienating creditors had been ten times as great as it was; that
instead of two, three, and four shillings in the pound, they had
received a farthing only in the pound; and that the certificates lay
now in the hands of the purchasers in that state, or even at a less
value, was there a member who would rise up and say, that the
purchasers ought to be paid the entire nominal sum, and the original
sufferer be entitled to no indemnification whatever?
Gentlemen had triumphed in the want of a precedent to the
measure. No government, it was said, had interposed to redress
fluctuations in its public paper. But where was the government that
had funded its debts under the circumstances of the American debt?
If no government had done so, there could be no precedent either
for or against the measure, because the occasion itself was
unprecedented. And if no similar occasion had before existed in any
country, the precedent to be set would at least be harmless, because
no similar occasion would be likely to happen in this.
If gentlemen persisted, however, in demanding precedents, he was
happy in being able to gratify them with two, which, though not
exactly parallel, were, on that account, of the greater force, since
the interposition of Government had taken place where the
emergency could less require them.
The first was the case of the Canada bills. During the war which
ended in 1763, and which was attended with a revolution of the
Government in Canada, the supplies obtained for the French army in
that province were paid for in bills of exchange and certificates. This
paper depreciated, and was bought up chiefly by British merchants.
The sum and the depreciation were so considerable as to become a
subject of negotiation between France and Great Britain at the
peace. The negotiations produced a particular article, by which it
was agreed by France that the paper ought to be redeemed, and
admitted by Great Britain that it should be redeemed at a liquidated
value. In the year 1766 this article was accordingly carried into effect
by ministers from the two courts, which reduced the paper in the
hands of the British holders, in some instances, as much as seventy-
five per cent. below its nominal value. It was stated, indeed, by the
reporter of the case, that the holders of the paper had themselves
concurred in the liquidation; but it was not probable that the
concurrence was voluntary. If it was voluntary, it shows that they
themselves were sensible of the equity of the sacrifice.
The other case was of still greater weight, as it had no relation to
war or treaty, and took place in the nation which has been held up
as a model with respect to public credit. In the year 1713, the civil
list of Great Britain had fallen into arrears to the amount of
£500,000. The creditors who had furnished supplies to the
Government had, instead of money, received debentures only from
the respective officers. These had depreciated. In that state, they
were assigned in some instances; in others, covenanted to be
assigned. When the Parliament appropriated funds for satisfying
these arrears, they inserted an express provision in the act, that the
creditors who had been obliged, by the default of Government, to
dispose of their paper at a loss, might redeem it from the assignees
by repaying the actual price, with an interest of six per cent., and
that all agreements and covenants to assign should be absolutely
void. Here then was an interposition on the very principle, that a
Government ought to redress the wrongs sustained by its default,
and on an occasion trivial when compared to that under
consideration; yet it does not appear that the public credit of the
nation was injured by it.
The best source of confidence in Government was the apparent
honesty of its views. The proposition could not possibly be ascribed
to any other motive than this, because the public was not to gain a
farthing by it. The next source was an experienced punctuality in the
payments due from the Government. For this support to public
credit, he relied on what had been experienced by a part of the
foreign creditors; on the provision to be made for the residue; and
on the punctuality which, he flattered himself, would be observed in
all future payments of the domestic creditors. He was more
apprehensive of injury to public credit from such modifications of the
interest of the public debt as some gentlemen seemed to have in
view. In these the public would be the gainer, and the plea of
inability the more alarming, because it was so easy to set up, so
difficult to be disproved, and for which, consequently, the
temptations would be so alluring.
Mr. Seney rose and observed, that it was with reluctance he
attempted to express to the committee his ideas upon a question
which had been so fully and ably discussed. However, as it had been
expected that gentlemen would not, in a case of such magnitude, be
content with merely a silent vote, he rose to declare the reasons
upon which his decision was founded. In doing this, he hoped that
he should not use epithets which might be deemed harsh, or
language which would be offensive; that although the sentiments of
other members should differ from his, he wished so far to respect
those sentiments as to treat them with decency.
He considered the proposition of the gentleman from Virginia (Mr.
Madison) was designed to effect two purposes: the one, a
compensation to the original creditors, who, during the late war, in
times of distress, had loaned money, furnished supplies, and
rendered military services; and who had only received satisfaction
therefor in paper of inconsiderable value, forced on them by the
public, and depreciated by their acts. This class of citizens, he
conceived, had a just and equitable claim for the full difference in
value between that paper, when paid, and specie. The other object
of the proposition alluded to, was, he said, to compensate those
creditors who now hold alienated certificates. Each description of
those creditors had, in his opinion, claims on the public. The first
was founded on an original contract between them and the
Government, part of which only had been complied with, and the
residue still remained undischarged. The other was grounded on
having possession of the paper which contained the promise to pay.
It has been contended that the United States have not ability to pay
both. In this case a question arises: What is, upon the whole, most
just and expedient? Some gentlemen contend, that it is incumbent
on us to make full provision for those who hold the assigned
certificates, without any for the original creditors who have alienated
them. Others think, that the misfortune of Government, in this
respect, should not be felt by either class solely, but be borne by
both. That it is more just to adopt a mode of composition, by which
those creditors should mutually share in this misfortune, and be
mutually benefited by a provision within our power to make; with
those his sentiments accorded. He could not be impressed with the
justice or reason of a measure calculated to make a total sacrifice of
one class of creditors, and full payment to the other class. Such a
step could not, in his opinion, be justified in any distinction or
precedence which existed in their claims. When it was considered
that the original creditors furnished money and supplies, and
rendered services essential to the preservation of their country, and
at a time when its liberties were invaded, and every thing which can
be dear to freemen was in jeopardy and at stake, he could not
apprehend that their claims would be deemed inferior to those of
their rivals. In his opinion, these circumstances entitled them to
superior notice. Believing, however, that the amendment under
consideration would, upon the whole, effect more substantial justice
than any other practicable scheme that had been proposed to the
committee, or which he had heard of, his assent would, therefore,
be given to it.
Tuesday, February 19.

Public Credit.
The House again went into a committee on the report of the
Secretary of the Treasury, Mr. Baldwin in the chair.
Mr. Madison's proposition still under consideration.
Mr. Livermore said he was against any discrimination between the
soldier and other public creditor, who held a public security, made
payable to bearer, and consequently transferable, with intent that
they might be sold, if convenience or necessity should require it.
This had been understood by all parties, as well in America as in
foreign countries, and they had been sold accordingly. The
advocates for discrimination have not denied this; they have only
alleged that the low rate at which the poor soldier or other public
creditor had sold his securities was a sufficient reason for Congress
to interfere and set aside the sale. In opposition to this, he
observed, that persons had a right to buy and sell at such prices as
they could mutually agree upon, provided there was no fraud.
A diamond, a horse, or a lot of ground, might be sold too cheap, or
too dear, and so might any other property; but Government could
not interfere without destroying the general system of law and
justice. Esau had sold his birthright for a mess of pottage, and
heaven and earth had confirmed the sale. The distresses of the
army, both officers and soldiers, at the time they received and sold
their securities, had been painted in too strong colors. They were
not so emaciated by sickness and famine as had been represented.
They were crowned with victory, and received with applause by their
fellow-citizens; and although they had been paid in paper, their loss
had been made up by large bounties, and in other emoluments; so
that, in point of property, they were equal to their fellow-citizens
who had borne the burden of taxes under which many are laboring
to this day. Let them be called brave soldiers, patriotic soldiers, but
not poor soldiers. They ought to be governed by the same system of
justice that governs others; but their contracts ought not to be set
aside out of partiality to them. The case quoted from the statute of
Queen Anne is not applicable to this case, inasmuch as Government
had not originally made the debentures therein mentioned
transferable. Neither did the case of the Canada bills apply; for, as
he understood, those bills were paid to British merchants and to
others who had purchased them.
Mr. Madison.—If paper, or the honor of statues or medals can
discharge the debts of justice, payable in gold or silver, we can not
only exonerate ourselves from those due to the original holders, but
from those of the assignees. So far as paper goes, the latter have
received the compensation. If honor can discharge the debt, they
have received civil honors; look around to the officers of every
Government in the Union, and you find them sharing equal honors
with those bestowed on the original creditors. But, sir, the debt due
in gold and silver is not payable either in honor, appointments, or in
paper.
Gentlemen say it will work injustice; but are we not as much bound
to repair the injustice done by the United States? Yet I do not
believe the assertion has been established by any thing that has
been urged in its support. The gentleman from Maryland (Mr. Stone)
acknowledges that there is a moral obligation to compensate the
original holders; how will they get what he admits is their due? He is
willing to make an effort, by applying the resources of the country to
that purpose; but if we are to judge by the sentiments of other
gentlemen who have spoken on this occasion, we have little to
expect from that quarter. Suppose the debt had depreciated to a
mere trifle, and suppose the sale of the Western Territory had
extinguished the certificates, let me ask, whether, if the United
States had thus exonerated themselves from the obligation to the
assignee, whether the claim of the original holder would not still
remain in its full force in a moral view? But believing the point of
justice to be exhausted, I will just add one remark upon the
practicability. The transferred certificates, generally, will show the
names of the original holders, and here there is no difficulty. With
respect to those granted to the heads of either of the five great
departments, the books of the Treasurer of Loans, as well as the
accounts of those departments now in the Treasury, will designate,
with a great degree of accuracy, and this may be followed up by the
usual mode of obtaining evidence; and I believe every security may
be provided against fraud in this case that was provided in the case
of the commissioners who were sent into the respective States for
ascertaining and liquidating the claims of individuals. That there will
be some difficulty I admit, but it is enough for me that it is not
insuperable; and I trust, with the assistance which the cause of
equity and justice will ever obtain from the members of the National
Legislature, they will easily be surmounted.

Monday, February 22.

Public Credit.
The House then resolved itself into a committee on the Report of the
Secretary of the Treasury, Mr. Baldwin in the chair.
Mr. Madison's proposition still under consideration.
Mr. Page.—As the worthy and eloquent member who replied to me
did not answer the questions I put to the committee, I suppose, he
either did not hear them, did not understand me, or could not
answer them. I hope, before the committee decide, they will attempt
at least to resolve them. I asked, where is the injustice of the State's
complying with its engagements made to the first holders of
certificates as far as the case admits? Where is the justice of doing
more for the assignee than he or his assignor expected could or
would be done? Where is the breach of faith in Government, if it
paid its whole debt with justice, blended with mercy? Where is the
interference in contracts, when the proposition is to comply sacredly,
as far as the case will admit, with the contracts between a State and
its creditors? I asked, is not the assignment of certificates confirmed
by the motion? Does it not give to the assignee the very thing
stipulated to be given, that is, whatever sum Government shall be
pleased to pay for the certificates, for that was the condition of the
assignment? And is not the sum now proposed more than either the
first or last holder, till within these few days, supposed would be paid
him? I asked also, ought not an honest assignee to be pleased that
Government intends to do that justice to his assignor which he
ought to do himself, were the whole payment made to him? I asked,
of what is the assignee deprived but of his late sanguine
expectations? I asked, whether the proposition before us does not
rather establish confidence in Government than the contrary? For, sir,
to make use of the comparison which has been often made here
between the State and an obligor on a bond, what could give more
credit to any man's bonds than to find that, though they had
depreciated to half a crown in the pound, he paid the whole twenty
shillings; ten shillings to the assignee, who had given but two
shillings and sixpence, and ten to the obligee who had sold at so
great a loss?
It is true Congress may, consistently with the rules of common law
courts, pay the bearer and take no notice of the creditors; but were
a Court of Equity instituted to decide on the case of certain
speculators, how would they decide? Government, in the most
solemn manner, pledged itself to make compensation to the soldiers,
have they done it? Instead of doing this, certain persons, who took
advantage of their ignorance and their poverty, bought up the
evidence of their debt at one-eighth of the nominal value; and in
some States these very men had drawn what constituted the
principal of the purchase with six per cent. interest in three years.
In what does the case differ between the depreciated paper and the
certificates? Paper money was redeemed at forty for one, as well to
the last as the first holder; the same principle would lead to give the
last holder of the certificate the depreciated value at which he
bought it. But we propose to work no injustice, we give the first
holder, if he is the holder still, the full value stipulated. It would not
be injustice to consider the assignee, as having paid what he
advanced, in consequence of his confidence in Government, on
account of that Government; and that the Government ought to
repay him what he so advanced; having repaid that sum, the
balance ought to go to the credit of the assignee. I am willing, on
this consideration, to call the speculator the friend and supporter of
the Government, who kindly lent us when in need, two shillings and
sixpence in every pound, to advance to the poor soldier. If
certificates are the evidence of the debt, it proves, sir, that the
balance is due to him in whose name it issued. This is the day of
payment, and we must pay accordingly; and here permit me to
remark, in reply to the observation of the gentleman from New
Hampshire, (Mr. Livermore,) that Jacob was punished for his fraud,
but for his faith enjoyed the promise; even so let us regard those
who had so much confidence in us as to advance two shillings and
sixpence to the distressed soldier.
Mr. Heister was in hopes this question would be postponed for the
present, in order to go into a consideration of the ways and means:
when, if it appeared that the United States were incapable of making
full provision, it might be considered, whether one deviation would
not authorize the other? If any gentleman would make a motion to
that effect, he would second him.
The question was now taken on Mr. Madison's proposition for a
composition, and it passed in the negative; yeas 13, nays 36.[35]

Wednesday, March 17.

On Slavery.
The House again resolved itself into a Committee of the Whole on
the Report of the committee, to whom was referred the memorial of
the people called Quakers, &c., Mr. Benson in the chair.
The question of order was put, when it was determined that Mr.
Tucker's last amendment was not in order.
The report was then taken up by paragraphs. The first proposition
being read,
Mr. White moved that it be struck out. He did this, he said, because
he was against entering into a consideration at this time of the
powers of Congress. He thought it would be time enough for this
when the powers are called in question. He then read the next,
which he said was entirely unnecessary, as it contains nothing more
than what is contained in express terms in the constitution. He
passed on to the third, which he said was equally unnecessary; and
to the fourth, which was provided for by the constitution. He said,
that he should agree to the fifth and sixth, with certain
modifications. Agreeable to this idea, he offered those two in a
different form. He disagreed to the seventh proposition, as
unnecessary and improper. He concluded by observing, that his wish
was to promote the happiness of mankind—and among the rest
those who are the objects of the present consideration—but this he
wished to do in conformity to the principles of justice and with a due
regard to the peace and happiness of others; he would contribute all
in his power to their comfort and well-being while in a state of
slavery; but he was fully of opinion that Congress has no right to
interfere in the business, any further than he proposed by the two
propositions as modified. He did not, however, anticipate the
difficulties from a total prohibition which some gentlemen seem to
apprehend—and if Congress had it in their power to interdict this
business at the present moment, he did not think the essential
interests of the Southern States would suffer. Twenty years ago, he
supposed the idea he now suggested would have caused universal
alarm. Virginia, however, about twelve years since, prohibited the
importation of negroes from Africa, and the consequences
apprehended never were realized; on the contrary, the agriculture of
that State was never in a more flourishing situation.
Mr. Hartley.—I have the honor to be one of the committee on the
memorials, and will, with the leave of this committee, mention some
particulars which took place in the course of the investigation of the
business. He premised that he was sorry that the question of right
had been brought forward yesterday—and was not a little surprised
to hear the cause of slavery advocated in that House, and language
held towards the petitioners which his experience had never shown
to be Parliamentary—he read some memorandums taken in
committee, and had particular reference to a law passed in Grenada,
which he applauded for its humanity, and truly benevolent spirit. He
reprobated the illiberal treatment which the memorialists had
received, and asserted that they were friends to the constitution,
and that on the present occasion they came forward from the most
laudable motives, from a wish to promote the happiness of mankind;
that their conduct, so far from meriting censure, deserved, and
would receive, the applause of the civilized world.
Mr. Brown, in a considerable speech, advocated the motion of Mr.
White. He enlarged on the pernicious consequences that may be
expected to flow from the interference of Congress; he pointed out
the effects which had resulted from the interposition of the Quakers,
by which the prospects of the Southern States in slaves had been
rendered very precarious—and if Congress should adopt the report
as it stands, the consequences would be pernicious in the highest
degree. The negro property will be annihilated. The emancipation of
slaves will be effected in time, it ought to be a gradual business; but
he hoped that Congress would not, to gratify people who never had
been friendly to the independence of America, precipitate the
business to the great injury of the Southern States.
Mr. Burke entered into a very extensive consideration of the subject.
He gave an account of the humane treatment which the slaves of
the Southern States received, their habitations, families, children,
privileges, &c. He then showed that their emancipation would tend
to make them wretched in the highest degree. He animadverted with
great freedom on the past and present conduct of the Quakers. He
denied that they were the friends of freedom; he said, that during
the late war, they were for bringing this country under a foreign
yoke; they descended to the character of spies; they supplied the
enemy with provisions; they were guides and conductors to their
armies; and whenever the American army came into their
neighborhood, they found themselves in an enemy's country. Mr.
Burke was proceeding in this strain, when he was interrupted by
being called to order. A warm altercation ensued, and in the midst of
it, a motion was made that the committee rise. This motion was
negatived, and Mr. Burke added a few more observations on the
injustice of the measure of interference, as it respected the property
of the Southern States.
Mr. Smith (of South Carolina) said he lamented much that this
subject had been brought before the House; that he had deprecated
it from the beginning, because he foresaw that it would produce a
very unpleasant discussion; that it was a subject of a nature to
excite the alarms of the Southern members, who could not view,
without anxiety, any interference in it on the part of Congress. He
remarked, that as they were resolved into a Committee of the Whole
on the powers of Congress respecting slavery and the slave trade, in
consequence of certain memorials from the people called Quakers
and the Pennsylvania Society for the abolition of slavery, the whole
subject, as well as the contents of these memorials, was under
consideration. He should therefore enter into the business at large,
and offer some comments on the contents of the memorial.
The memorial from the Quakers contained, in his opinion, a very
indecent attack on the character of those States which possess
slaves. It reprobates slavery as bringing down reproach on the
Southern States, and expatiates on the detestation due to the
licentious wickedness of the African trade, and the inhuman tyranny
and bloodguiltiness inseparable from it. He could not but consider it
as calculated to fix a stigma of the blackest nature on the State he
had the honor to represent, and to hold its citizens up to public view
as men divested of every principle of honor and humanity.
Considering it in that light, he felt it incumbent on him not only to
refute those atrocious calumnies, but to resent the improper
Welcome to our website – the perfect destination for book lovers and
knowledge seekers. We believe that every book holds a new world,
offering opportunities for learning, discovery, and personal growth.
That’s why we are dedicated to bringing you a diverse collection of
books, ranging from classic literature and specialized publications to
self-development guides and children's books.

More than just a book-buying platform, we strive to be a bridge


connecting you with timeless cultural and intellectual values. With an
elegant, user-friendly interface and a smart search system, you can
quickly find the books that best suit your interests. Additionally,
our special promotions and home delivery services help you save time
and fully enjoy the joy of reading.

Join us on a journey of knowledge exploration, passion nurturing, and


personal growth every day!

ebookbell.com

You might also like