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

PDF Starting Out with C From Control Structures through Objects 7th Edition Edition Tony Gaddis download

Tony

Uploaded by

akyuzgliempc
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
366 views

PDF Starting Out with C From Control Structures through Objects 7th Edition Edition Tony Gaddis download

Tony

Uploaded by

akyuzgliempc
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 67

Visit https://ebookfinal.

com to download the full version and


explore more ebook

Starting Out with C From Control Structures through


Objects 7th Edition Edition Tony Gaddis

_____ Click the link below to download _____


https://ebookfinal.com/download/starting-out-with-c-
from-control-structures-through-objects-7th-edition-
edition-tony-gaddis/

Explore and download more ebook at ebookfinal.com


Here are some recommended products that might interest you.
You can download now and explore!

Starting Out with C Early Objects 5th Edition Tony Gaddis

https://ebookfinal.com/download/starting-out-with-c-early-objects-5th-
edition-tony-gaddis/

ebookfinal.com

Starting out with Visual C 2012 with CD Rom 3rd Edition


Tony Gaddis

https://ebookfinal.com/download/starting-out-with-visual-c-2012-with-
cd-rom-3rd-edition-tony-gaddis/

ebookfinal.com

Starting Out With App Inventor for Android 1st Edition


Tony Gaddis

https://ebookfinal.com/download/starting-out-with-app-inventor-for-
android-1st-edition-tony-gaddis/

ebookfinal.com

Starting Out the English Starting Out Everyman Chess 1st


Edition Neil Mcdonald

https://ebookfinal.com/download/starting-out-the-english-starting-out-
everyman-chess-1st-edition-neil-mcdonald/

ebookfinal.com
Starting Out Dutch Defence Starting Out Everyman Chess 1st
Edition Neil Macdonald

https://ebookfinal.com/download/starting-out-dutch-defence-starting-
out-everyman-chess-1st-edition-neil-macdonald/

ebookfinal.com

Starting Out Attacking Play Starting Out Everyman Chess


1st Edition James Plaskett

https://ebookfinal.com/download/starting-out-attacking-play-starting-
out-everyman-chess-1st-edition-james-plaskett/

ebookfinal.com

Data Structures and Other Objects Using C 4th Edition Main

https://ebookfinal.com/download/data-structures-and-other-objects-
using-c-4th-edition-main/

ebookfinal.com

Starting Out in Bridge 1st Edition Paul Lamford

https://ebookfinal.com/download/starting-out-in-bridge-1st-edition-
paul-lamford/

ebookfinal.com

Starting Out Defensive Play 1st Edition Angus Dunnington

https://ebookfinal.com/download/starting-out-defensive-play-1st-
edition-angus-dunnington/

ebookfinal.com
Starting Out with C From Control Structures through
Objects 7th Edition Edition Tony Gaddis Digital Instant
Download
Author(s): Tony Gaddis
ISBN(s): 9780132576253, 0132576252
Edition: 7th Edition
File Details: PDF, 53.69 MB
Year: 2011
Language: english
get with the programming

Through the power of practice and immediate personalized


feedback, MyProgrammingLab improves your performance.

Learn more at www.myprogramminglab.com


STARTING OUT WITH

C++
From Control Structures
through Objects
SEVENTH EDITION

Tony Gaddis
Haywood Community College

Addison-Wesley
Boston Columbus Indianapolis New York San Francisco Upper Saddle River
Amsterdam Cape Town Dubai London Madrid Milan Munich Paris Montreal Toronto
Delhi Mexico City Sao Paulo Sydney Hong Kong Seoul Singapore Taipei Tokyo
Editorial Director: Marcia Horton Manufacturing Buyer: Lisa McDowell
Editor-in-Chief: Michael Hirsch Art Director: Linda Knowles
Editorial Assistant: Stephanie Sellinger Cover Designer: Joyce Cosentino Wells
Vice President, Marketing: Patrice Jones Cover Image: © Fotosearch/Rubberball Photos
Marketing Manager: Yezan Alayan Media Editor: Daniel Sandin
Marketing Coordinator: Kathryn Ferranti Media Project Manager: Wanda Rockwell
Vice President, Production: Vince O Brien Full-Service Vendor: Aptara®, Inc.
Managing Editor: Jeff Holcomb Project Management: Dennis Free/Aptara®, Inc.
Senior Production Project Manager: Marilyn Lloyd Printer/Binder: Edwards Brothers
Senior Operations Supervisor: Alan Fischer Cover Printer: Lehigh-Phoenix Color

Copyright © 2012, 2009, 2007, 2005 Pearson Education, Inc., publishing as Addison-Wesley. All rights
reserved. Manufactured in the United States of America. This publication is protected by Copyright, and per-
mission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval sys-
tem, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise.
To obtain permission(s) to use material from this work, please submit a written request to Pearson Education,
Inc., Permissions Department, 501 Boylston Street, Suite 900, Boston, Massachusetts 02116.

Many of the designations by manufacturers and sellers to distinguish their products are claimed as trademarks.
Where those designations appear in this book, and the publisher was aware of a trademark claim, the designa-
tions have been printed in initial caps or all caps.

Library of Congress Cataloging-in-Publication Data

Gaddis, Tony.
Starting out with C++ : from control structures through objects / Tony
Gaddis. 7th ed.
p. cm.
Includes bibliographical references and index.
ISBN-13: 978-0-13-257625-3 (alk. paper)
ISBN-10: 0-13-257625-2 (alk. paper)
1. C++ (Computer program language) I. Title.
QA76.73.C153G33 2012
005.13'3 dc22
2011003252

10 9 8 7 6 5 4 3 2 1 EB 15 14 13 12 11

ISBN 13: 978-0-13-257625-3


ISBN 10: 0-13-257625-2
Contents at a Glance

Preface xiii
CHAPTER 1 Introduction to Computers and Programming 1
CHAPTER 2 Introduction to C++ 27
CHAPTER 3 Expressions and Interactivity 85
CHAPTER 4 Making Decisions 149
CHAPTER 5 Loops and Files 227
CHAPTER 6 Functions 301
CHAPTER 7 Arrays 377
CHAPTER 8 Searching and Sorting Arrays 451
CHAPTER 9 Pointers 491
CHAPTER 10 Characters, C-Strings, and More About the String Class 541
CHAPTER 11 Structured Data 593
CHAPTER 12 Advanced File Operations 651
CHAPTER 13 Introduction to Classes 705
CHAPTER 14 More About Classes 799
CHAPTER 15 Inheritance, Polymorphism, and Virtual Functions 869
CHAPTER 16 Exceptions, Templates, and the Standard Template Library (STL) 947
CHAPTER 17 Linked Lists 1003
CHAPTER 18 Stacks and Queues 1043
CHAPTER 19 Recursion 1101
CHAPTER 20 Binary Trees 1137

Appendix A: Getting Started with Alice 1167


Appendix B: The ASCII Character Set 1195
Appendix C: Operator Precedence and Associativity 1197
Quick References 1199
Index 1201

v
vi Contents at a Glance

Online The following appendices are available at www.pearsonhighered.com/gaddis.


Appendix D: Introduction to Flowcharting
Appendix E: Using UML in Class Design
Appendix F: Namespaces
Appendix G: Writing Managed C++ Code for the .NET Framework
Appendix H: Passing Command Line Arguments
Appendix I: Header File and Library Function Reference
Appendix J: Binary Numbers and Bitwise Operations
Appendix K: Multi-Source File Programs
Appendix L: Stream Member Functions for Formatting
Appendix M: Introduction to Microsoft Visual C++ 2010 Express Edition
Appendix N: Answers to Checkpoints
Appendix O: Solutions to Odd-Numbered Review Questions
Contents

Preface xiii

CHAPTER 1 Introduction to Computers and Programming 1


1.1 Why Program? 1
1.2 Computer Systems: Hardware and Software 3
1.3 Programs and Programming Languages 8
1.4 What Is a Program Made of? 13
1.5 Input, Processing, and Output 17
1.6 The Programming Process 18
1.7 Procedural and Object-Oriented Programming 22

CHAPTER 2 Introduction to C++ 27


2.1 The Parts of a C++ Program 27
2.2 The cout Object 31
2.3 The #include Directive 36
2.4 Variables and Literals 37
2.5 Identifiers 41
2.6 Integer Data Types 42
2.7 The char Data Type 47
2.8 The C++ string Class 51
2.9 Floating-Point Data Types 53
2.10 The bool Data Type 56
2.11 Determining the Size of a Data Type 57
2.12 Variable Assignments and Initialization 58
2.13 Scope 59
2.14 Arithmetic Operators 60
2.15 Comments 68
2.16 Named Constants 70
2.17 Programming Style 72
2.18 If You Plan to Continue in Computer Science: Standard and Prestandard C++ 74

vii
viii Contents

CHAPTER 3 Expressions and Interactivity 85


3.1 The cin Object 85
3.2 Mathematical Expressions 91
3.3 When You Mix Apples and Oranges: Type Conversion 100
3.4 Overflow and Underflow 102
3.5 Type Casting 103
3.6 Multiple Assignment and Combined Assignment 107
3.7 Formatting Output 111
3.8 Working with Characters and string Objects 120
3.9 More Mathematical Library Functions 127
3.10 Focus on Debugging: Hand Tracing a Program 130
3.11 Focus on Problem Solving: A Case Study 132

CHAPTER 4 Making Decisions 149


4.1 Relational Operators 149
4.2 The if Statement 154
4.3 Expanding the if Statement 162
4.4 The if/else Statement 166
4.5 Nested if Statements 169
4.6 The if/else if Statement 176
4.7 Flags 181
4.8 Logical Operators 182
4.9 Checking Numeric Ranges with Logical Operators 189
4.10 Menus 190
4.11 Focus on Software Engineering: Validating User Input 193
4.12 Comparing Characters and Strings 195
4.13 The Conditional Operator 199
4.14 The switch Statement 202
4.15 More About Blocks and Scope 211

CHAPTER 5 Loops and Files 227


5.1 The Increment and Decrement Operators 227
5.2 Introduction to Loops: The while Loop 232
5.3 Using the while Loop for Input Validation 239
5.4 Counters 241
5.5 The do-while Loop 242
5.6 The for Loop 247
5.7 Keeping a Running Total 257
5.8 Sentinels 260
5.9 Focus on Software Engineering: Deciding Which Loop to Use 261
5.10 Nested Loops 262
5.11 Using Files for Data Storage 265
5.12 Optional Topics: Breaking and Continuing a Loop 285

CHAPTER 6 Functions 301


6.1 Focus on Software Engineering: Modular Programming 301
6.2 Defining and Calling Functions 303
6.3 Function Prototypes 311
6.4 Sending Data into a Function 313
Contents ix

6.5 Passing Data by Value 318


6.6 Focus on Software Engineering: Using Functions in a Menu-Driven Program 320
6.7 The return Statement 324
6.8 Returning a Value from a Function 326
6.9 Returning a Boolean Value 334
6.10 Local and Global Variables 336
6.11 Static Local Variables 344
6.12 Default Arguments 347
6.13 Using Reference Variables as Parameters 350
6.14 Overloading Functions 356
6.15 The exit() Function 360
6.16 Stubs and Drivers 363

CHAPTER 7 Arrays 377


7.1 Arrays Hold Multiple Values 377
7.2 Accessing Array Elements 379
7.3 No Bounds Checking in C++ 386
7.4 Array Initialization 389
7.5 Processing Array Contents 394
7.6 Focus on Software Engineering: Using Parallel Arrays 402
7.7 Arrays as Function Arguments 405
7.8 Two-Dimensional Arrays 416
7.9 Arrays with Three or More Dimensions 423
7.10 Focus on Problem Solving and Program Design: A Case Study 424
7.11 If You Plan to Continue in Computer Science: Introduction to the
STL vector 427

CHAPTER 8 Searching and Sorting Arrays 451


8.1 Focus on Software Engineering: Introduction to Search Algorithms 451
8.2 Focus on Problem Solving and Program Design: A Case Study 458
8.3 Focus on Software Engineering: Introduction to Sorting Algorithms 464
8.4 Focus on Problem Solving and Program Design: A Case Study 472
8.5 If You Plan to Continue in Computer Science: Sorting and
Searching vectors 480

CHAPTER 9 Pointers 491


9.1 Getting the Address of a Variable 491
9.2 Pointer Variables 493
9.3 The Relationship Between Arrays and Pointers 500
9.4 Pointer Arithmetic 504
9.5 Initializing Pointers 506
9.6 Comparing Pointers 507
9.7 Pointers as Function Parameters 509
9.8 Focus on Software Engineering: Dynamic Memory Allocation 518
9.9 Focus on Software Engineering: Returning Pointers from Functions 522
9.10 Focus on Problem Solving and Program Design: A Case Study 529

CHAPTER 10 Characters, C-Strings, and More About the string Class 541
10.1 Character Testing 541
10.2 Character Case Conversion 545
x Contents

10.3 C-Strings 548


10.4 Library Functions for Working with C-Strings 552
10.5 C-String/Numeric Conversion Functions 563
10.6 Focus on Software Engineering: Writing Your Own
C-String-Handling Functions 568
10.7 More About the C++ string Class 574
10.8 Focus on Problem Solving and Program Design: A Case Study 584

CHAPTER 11 Structured Data 593


11.1 Abstract Data Types 593
11.2 Focus on Software Engineering: Combining Data
into Structures 595
11.3 Accessing Structure Members 598
11.4 Initializing a Structure 602
11.5 Arrays of Structures 605
11.6 Focus on Software Engineering: Nested Structures 608
11.7 Structures as Function Arguments 612
11.8 Returning a Structure from a Function 615
11.9 Pointers to Structures 618
11.10 Focus on Software Engineering: When to Use ., When to Use ->,
and When to Use * 621
11.11 Unions 623
11.12 Enumerated Data Types 627

CHAPTER 12 Advanced File Operations 651


12.1 File Operations 651
12.2 File Output Formatting 658
12.3 Passing File Stream Objects to Functions 660
12.4 More Detailed Error Testing 662
12.5 Member Functions for Reading and Writing Files 665
12.6 Focus on Software Engineering: Working with Multiple Files 672
12.7 Binary Files 674
12.8 Creating Records with Structures 679
12.9 Random-Access Files 683
12.10 Opening a File for Both Input and Output 691

CHAPTER 13 Introduction to Classes 705


13.1 Procedural and Object-Oriented Programming 705
13.2 Introduction to Classes 712
13.3 Defining an Instance of a Class 717
13.4 Why Have Private Members? 728
13.5 Focus on Software Engineering: Separating Class Specification
from Implementation 729
13.6 Inline Member Functions 735
13.7 Constructors 738
13.8 Passing Arguments to Constructors 742
13.9 Destructors 750
13.10 Overloading Constructors 754
13.11 Private Member Functions 758
13.12 Arrays of Objects 759
Contents xi

13.13 Focus on Problem Solving and Program Design: An OOP Case Study 763
13.14 Focus on Object-Oriented Programming: Creating an Abstract Array
Data Type 770
13.15 Focus on Object-Oriented Design: The Unified Modeling Language (UML) 774
13.16 Focus on Object-Oriented Design: Finding the Classes and Their
Responsibilities 777

CHAPTER 14 More About Classes 799


14.1 Instance and Static Members 799
14.2 Friends of Classes 807
14.3 Memberwise Assignment 812
14.4 Copy Constructors 813
14.5 Operator Overloading 819
14.6 Object Conversion 846
14.7 Aggregation 849
14.8 Focus on Object-Oriented Design: Class Collaborations 853

CHAPTER 15 Inheritance, Polymorphism, and Virtual Functions 869


15.1 What Is Inheritance? 869
15.2 Protected Members and Class Access 878
15.3 Constructors and Destructors in Base and Derived Classes 884
15.4 Redefining Base Class Functions 896
15.5 Class Hierarchies 901
15.6 Polymorphism and Virtual Member Functions 907
15.7 Abstract Base Classes and Pure Virtual Functions 921
15.8 Multiple Inheritance 928

CHAPTER 16 Exceptions, Templates, and the Standard Template Library (STL) 947
16.1 Exceptions 947
16.2 Function Templates 966
16.3 Focus on Software Engineering: Where to Start When Defining Templates 972
16.4 Class Templates 973
16.5 Introduction to the Standard Template Library (STL) 983

CHAPTER 17 Linked Lists 1003


17.1 Introduction to the Linked List ADT 1003
17.2 Linked List Operations 1005
17.3 A Linked List Template 1022
17.4 Variations of the Linked List 1034
17.5 The STL list Container 1035

CHAPTER 18 Stacks and Queues 1043


18.1 Introduction to the Stack ADT 1043
18.2 Dynamic Stacks 1060
18.3 The STL stack Container 1071
18.4 Introduction to the Queue ADT 1073
18.5 Dynamic Queues 1085
18.6 The STL deque and queue Containers 1092
xii Contents

CHAPTER 19 Recursion 1101


19.1 Introduction to Recursion 1101
19.2 Solving Problems with Recursion 1106
19.3 Focus on Problem Solving and Program Design: The Recursive
gcd Function 1113
19.4 Focus on Problem Solving and Program Design: Solving Recursively
Defined Problems 1114
19.5 Focus on Problem Solving and Program Design: Recursive Linked
List Operations 1116
19.6 Focus on Problem Solving and Program Design: A Recursive Binary
Search Function 1119
19.7 The Towers of Hanoi 1122
19.8 Focus on Problem Solving and Program Design: The QuickSort Algorithm 1125
19.9 Exhaustive Algorithms 1130
19.10 Focus on Software Engineering: Recursion vs. Iteration 1132

CHAPTER 20 Binary Trees 1137


20.1 Definition and Applications of Binary Trees 1137
20.2 Binary Search Tree Operations 1140
20.3 Template Considerations for Binary Search Trees 1157

Appendix A: Getting Started with Alice 1167


Appendix B: The ASCII Character Set 1195
Appendix C: Operator Precedence and Associativity 1197
Quick References 1199
Index 1201

Online The following appendices are available at www.pearsonhighered.com/gaddis.


Appendix D: Introduction to Flowcharting
Appendix E: Using UML in Class Design
Appendix F: Namespaces
Appendix G: Writing Managed C++ Code for the .NET Framework
Appendix H: Passing Command Line Arguments
Appendix I: Header File and Library Function Reference
Appendix J: Binary Numbers and Bitwise Operations
Appendix K: Multi-Source File Programs
Appendix L: Stream Member Functions for Formatting
Appendix M: Introduction to Microsoft Visual C++ 2010 Express Edition
Appendix N: Answers to Checkpoints
Appendix O: Solutions to Odd-Numbered Review Questions
Preface

Welcome to Starting Out with C++: From Control Structures through Objects, 7th edi-
tion. This book is intended for use in a two-semester C++ programming sequence, or an
accelerated one-semester course. Students new to programming, as well as those with
prior course work in other languages, will nd this text bene cial. The fundamentals of
programming are covered for the novice, while the details, pitfalls, and nuances of the
C++ language are explored in-depth for both the beginner and more experienced student.
The book is written with clear, easy-to-understand language and it covers all the necessary
topics for an introductory programming course. This text is rich in example programs that
are concise, practical, and real-world oriented, ensuring that the student not only learns
how to implement the features and constructs of C++, but why and when to use them.

Changes in the Seventh Edition


This book s pedagogy, organization, and clear writing style remain the same as in the pre-
vious edition. Many improvements have been made, which are summarized here:
This edition uses string objects, instead of char arrays, as the preferred way to
store strings. This change has been made throughout the entire book. A thorough
discussion of C-strings and the technique of storing them in char arrays is pro-
vided as a topic in Chapter 10.
All of the introductory file I/O material has been consolidated and moved to
Chapter 5. In previous editions, this material was gradually introduced in Chap-
ters 3 through 5. Many reviewers requested that all the material be given in one
place, after loops have been covered.
Named constants are now introduced in Chapter 2, after variables.
In Chapter 2 an additional In the Spotlight section demonstrating the modulus
operator has been added.
Chapter 4 has been reorganized so that all the fundamental decision structure
topics appear early in the chapter.
A discussion of passing arrays using const references has been added to Chapter 7.

xiii
xiv Preface

An In the Spotlight section giving an additional example of inheritance has been


added to Chapter 15.
Template examples for stacks, queues, and binary search trees have been added to
Chapters 18 and 20.
The Serendipity Booksellers project has been moved to the book s online resource
page at www.pearsonhighered.com/gaddis.

Organization of the Text


This text teaches C++ in a step-by-step fashion. Each chapter covers a major set of topics
and builds knowledge as the student progresses through the book. Although the chapters
can be easily taught in their existing sequence, some exibility is provided. The diagram
shown in Figure P-1 suggests possible sequences of instruction.
Chapter 1 covers fundamental hardware, software, and programming concepts. You may
choose to skip this chapter if the class has already mastered those topics. Chapters 2
through 7 cover basic C++ syntax, data types, expressions, selection structures, repetition
structures, functions, and arrays. Each of these chapters builds on the previous chapter
and should be covered in the order presented.
After Chapter 7 has been covered, you may proceed to Chapter 8, or jump to either Chap-
ter 9 or Chapter 12. (If you jump to Chapter 12 at this point, you will need to postpone
sections 12.7, 12.8, and 12.10 until Chapters 9 and 11 have been covered.)
After Chapter 9 has been covered, either of Chapters 10 or 11 may be covered. After
Chapter 11, you may cover Chapters 13 through 17 in sequence. Next you can proceed to
either Chapter 18 or Chapter 19. Finally, Chapter 20 may be covered.
This text s approach starts with a rm foundation in structured, procedural programming
before delving fully into object-oriented programming and advanced data structures.

Brief Overview of Each Chapter

Chapter 1: Introduction to Computers and Programming


This chapter provides an introduction to the eld of computer science and covers the funda-
mentals of programming, problem solving, and software design. The components of pro-
grams, such as key words, variables, operators, and punctuation are covered. The tools of
the trade, such as pseudocode, ow charts, and hierarchy charts are also presented.

Chapter 2: Introduction to C++


This chapter gets the student started in C++ by introducing data types, identi ers, variable
declarations, constants, comments, program output, simple arithmetic operations, and C-
strings. Programming style conventions are introduced and good programming style is
modeled here, as it is throughout the text. An optional section explains the difference
between ANSI standard and pre-standard C++ programs.
Preface xv

Figure P-1

Chapter 1
Introduction

Chapters 2 7
Basic Language
Elements

Chapter 8 Chapter 9 Chapter 12


Searching And Pointers Advanced File
Sorting Arrays Operations*

*A few subtopics in
Chapter 12 require
Chapter 10 Chapters 9 and 11.
Characters, Strings, Chapter 11
and the string Class Structures

Chapter 13
Introduction to
Classes

Chapter 14
More About Classes

Chapter 15
Inheritance and
Polymorphism

Chapter 16
Exceptions,
Templates, and STL

Chapter 17
Linked Lists

Chapter 18 Chapter 19
Stacks and Queues Recursion

Chapter 20
Binary Trees
xvi Preface

Chapter 3: Expressions and Interactivity


In this chapter the student learns to write programs that input and handle numeric, char-
acter, and string data. The use of arithmetic operators and the creation of mathematical
expressions are covered in greater detail, with emphasis on operator precedence. Debug-
ging is introduced, with a section on hand tracing a program. Sections are also included
on simple output formatting, on data type conversion and type casting, and on using
library functions that work with numbers.

Chapter 4: Making Decisions


Here the student learns about relational operators, relational expressions and how to con-
trol the ow of a program with the if, if/else, and if/else if statements. The condi-
tional operator and the switch statement are also covered. Crucial applications of these
constructs are covered, such as menu-driven programs and the validation of input.

Chapter 5: Loops and Files


This chapter covers repetition control structures. The while loop, do-while loop, and for
loop are taught, along with common uses for these devices. Counters, accumulators, run-
ning totals, sentinels, and other application-related topics are discussed. Sequential le I/O is
also introduced. The student learns to read and write text les, and use loops to process the
data in a le.

Chapter 6: Functions
In this chapter the student learns how and why to modularize programs, using both void
and value returning functions. Argument passing is covered, with emphasis on when argu-
ments should be passed by value versus when they need to be passed by reference. Scope
of variables is covered and sections are provided on local versus global variables and on
static local variables. Overloaded functions are also introduced and demonstrated.

Chapter 7: Arrays
In this chapter the student learns to create and work with single and multidimensional
arrays. Many examples of array processing are provided including examples illustrating
how to nd the sum, average, highest and lowest values in an array and how to sum the
rows, columns, and all elements of a two-dimensional array. Programming techniques using
parallel arrays are also demonstrated and the student is shown how to use a data le as an
input source to populate an array. STL vectors are introduced and compared to arrays.

Chapter 8: Sorting and Searching Arrays


Here the student learns the basics of sorting arrays and searching for data stored in them.
The chapter covers the Bubble Sort, Selection Sort, Linear Search, and Binary Search algo-
rithms. There is also a section on sorting and searching STL vector objects.
Preface xvii

Chapter 9: Pointers
This chapter explains how to use pointers. Pointers are compared to and contrasted with
reference variables. Other topics include pointer arithmetic, initialization of pointers, rela-
tional comparison of pointers, pointers and arrays, pointers and functions, dynamic mem-
ory allocation, and more.

Chapter 10: Characters, C-strings, and More About the string Class
This chapter discusses various ways to process text at a detailed level. Library functions
for testing and manipulating characters are introduced. C-strings are discussed, and the
technique of storing C-strings in char arrays is covered. An extensive discussion of the
string class methods is also given.

Chapter 11: Structured Data


The student is introduced to abstract data types and taught how to create them using struc-
tures, unions, and enumerated data types. Discussions and examples include using pointers
to structures, passing structures to functions, and returning structures from functions.

Chapter 12: Advanced File Operations


This chapter covers sequential access, random access, text, and binary les. The various
modes for opening les are discussed, as well as the many methods for reading and writing
le contents. Advanced output formatting is also covered.

Chapter 13: Introduction to Classes


The student now shifts focus to the object-oriented paradigm. This chapter covers the
fundamental concepts of classes. Member variables and functions are discussed. The
student learns about private and public access speci cations, and reasons to use each.
The topics of constructors, overloaded constructors, and destructors are also presented.
The chapter presents a section modeling classes with UML, and how to nd the classes
in a particular problem.

Chapter 14: More About Classes


This chapter continues the study of classes. Static members, friends, memberwise assign-
ment, and copy constructors are discussed. The chapter also includes in-depth sections on
operator overloading, object conversion, and object aggregation. There is also a section
on class collaborations and the use of CRC cards.

Chapter 15: Inheritance and Polymorphism


The study of classes continues in this chapter with the subjects of inheritance, polymor-
phism, and virtual member functions. The topics covered include base and derived class
constructors and destructors, virtual member functions, base class pointers, static and
dynamic binding, multiple inheritance, and class hierarchies.
xviii Preface

Chapter 16: Exceptions, Templates, and the Standard


Template Library (STL)
The student learns to develop enhanced error trapping techniques using exceptions. Dis-
cussion then turns to function and class templates as a method for reusing code. Finally,
the student is introduced to the containers, iterators, and algorithms offered by the Stan-
dard Template Library (STL).

Chapter 17: Linked Lists


This chapter introduces concepts and techniques needed to work with lists. A linked list
ADT is developed and the student is taught to code operations such as creating a linked
list, appending a node, traversing the list, searching for a node, inserting a node, deleting a
node, and destroying a list. A linked list class template is also demonstrated.

Chapter 18: Stacks and Queues


In this chapter the student learns to create and use static and dynamic stacks and queues. The
operations of stacks and queues are de ned, and templates for each ADT are demonstrated.

Chapter 19: Recursion


This chapter discusses recursion and its use in problem solving. A visual trace of recursive
calls is provided and recursive applications are discussed. Many recursive algorithms are
presented, including recursive functions for nding factorials, nding a greatest common
denominator (GCD), performing a binary search, and sorting (QuickSort). The classic
Towers of Hanoi example is also presented. For students who need more challenge, there
is a section on exhaustive algorithms.

Chapter 20: Binary Trees


This chapter covers the binary tree ADT, and demonstrates many binary tree operations.
The student learns to traverse a tree, insert an element, delete an element, replace an ele-
ment, test for an element, and destroy a tree.

Appendix A: Getting Started with Alice


This appendix gives a quick introduction to Alice. Alice is free software that can be used
to teach fundamental programming concepts using 3D graphics.

Appendix B: ASCII Character Set


A list of the ASCII and Extended ASCII characters and their codes.

Appendix C: Operator Precedence and Associativity


A chart showing the C++ operators and their precedence.
Preface xix

The following appendices are available online at www.pearsonhighered.com/gaddis.

Appendix D: Introduction to Flowcharting


A brief introduction to owcharting. This tutorial discusses sequence, selection, case, rep-
etition, and module structures.

Appendix E: Using UML in Class Design


This appendix shows the student how to use the Uni ed Modeling Language to design
classes. Notation for showing access speci cation, data types, parameters, return values,
overloaded functions, composition, and inheritance are included.

Appendix F: Namespaces
This appendix explains namespaces and their purpose. Examples showing how to de ne a
namespace and access its members are given.

Appendix G: Writing Managed C++ Code for the .NET Framework


This appendix introduces the student to the concepts surrounding managed C++ in
Microsoft s .NET environment.

Appendix H: Passing Command Line Arguments


Teaches the student how to write a C++ program that accepts arguments from the com-
mand line. This appendix will be useful to students working in a command line environ-
ment, such as Unix, Linux, or the Windows command prompt.

Appendix I: Header File and Library Function Reference


This appendix provides a reference for the C++ library functions and header les discussed
in the book.

Appendix J: Binary Numbers and Bitwise Operations


A guide to the C++ bitwise operators, as well as a tutorial on the internal storage of integers.

Appendix K: Multi-Source File Programs


Provides a tutorial on creating programs that consist of multiple source les. Function
header les, class speci cation les, and class implementation les are discussed.

Appendix L: Stream Member Functions for Formatting


Covers stream member functions for formatting such as setf.

Appendix M: Introduction to Microsoft Visual C++ 2010 Express Edition


A tutorial on how to start a project in Microsoft Visual C++ 2010 Express Edition, com-
pile a program, save source les, and more.
xx Preface

Appendix N: Answers to Checkpoints


Students may test their own progress by comparing their answers to the checkpoint exer-
cises against this appendix. The answers to all Checkpoints are included.

Appendix O: Solutions to Odd-Numbered Review Questions


Another tool that students can use to gauge their progress.

Features of the Text

Concept Each major section of the text starts with a concept statement.
Statements This statement summarizes the ideas of the section.
Example Programs The text has hundreds of complete example programs, each
designed to highlight the topic currently being studied. In most
cases, these are practical, real-world examples. Source code for
these programs is provided so that students can run the
programs themselves.
Program Output After each example program there is a sample of its screen
output. This immediately shows the student how the program
should function.
In the Spotlight Each of these sections provides a programming problem and a
detailed, step by step analysis showing the student how to solve
it.
VideoNotes A series of online videos, developed speci cally for this book, is
VideoNote available for viewing at www.pearsonhighered.com/gaddis.
Icons appear throughout the text alerting the student to videos
about speci c topics.
Checkpoints Checkpoints are questions placed throughout each chapter as a
self-test study aid. Answers for all Checkpoint questions can be
downloaded from the book s Companion Website at
www.pearsonhighered.com/gaddis. This allows students to
check how well they have learned a new topic.
Notes Notes appear at appropriate places throughout the text. They
are short explanations of interesting or often misunderstood
points relevant to the topic at hand.
Warnings Warnings are notes that caution the student about certain C++
features, programming techniques, or practices that can lead to
malfunctioning programs or lost data.
Preface xxi

Case Studies Case studies that simulate real-world applications appear in


many chapters throughout the text. These case studies are
designed to highlight the major topics of the chapter in which
they appear.
Review Questions Each chapter presents a thorough and diverse set of review
and Exercises questions, such as ll-in-the-blank and short answer, that check
the student s mastery of the basic material presented in the
chapter. These are followed by exercises requiring problem
solving and analysis, such as the Algorithm Workbench, Predict
the Output, and Find the Errors sections. Answers to the odd
numbered review questions and review exercises can be
downloaded from the book s Companion Website at
www.pearsonhighered.com/gaddis.
Programming Each chapter offers a pool of programming exercises designed
Challenges to solidify the student s knowledge of the topics currently being
studied. In most cases the assignments present real-world
problems to be solved. When applicable, these exercises include
input validation rules.
Group Projects There are several group programming projects throughout the
text, intended to be constructed by a team of students. One
student might build the program s user interface, while another
student writes the mathematical code, and another designs and
implements a class the program uses. This process is similar to
the way many professional programs are written and
encourages team work within the classroom.

Software Available for download from the book s Companion Website at


Development www.pearsonhighered.com/gaddis. This is an on-going project
Project: that instructors can optionally assign to teams of students. It
Serendipity systematically develops a real-world software package: a
Booksellers point-of-sale program for the ctitious Serendipity Booksellers
organization. The Serendipity assignment for each chapter adds
more functionality to the software, using constructs and
techniques covered in that chapter. When complete, the
program will act as a cash register, manage an inventory
database, and produce a variety of reports.
C++ Quick For easy access, a quick reference guide to the C++ language is
Reference Guide printed on the last two pages of Appendix C in the book.
xxii Preface

Supplements

Student Online Resources


Many student resources are available for this book from the publisher. The following items
are available on the Gaddis Series Companion Website at www.pearsonhighered.com/gaddis:
The source code for each example program in the book
Access to the book s companion VideoNotes
A full set of appendices, including answers to the Checkpoint questions, and
answers to the odd-numbered review questions
A collection of valuable Case Studies
The complete Serendipity Booksellers Project

Integrated Development Environment (IDE) Resource Kits


Professors who adopt this text can order it for students with a kit containing ve popular
C++ IDEs (Microsoft® Visual Studio 2010 Express Edition, Dev C++, NetBeans, Eclipse,
and CodeLite) and access to a Web site containing written and video tutorials for getting
started in each IDE. For ordering information, please contact your campus Pearson Edu-
cation representative or visit www.pearsonhighered.com/cs.

Online Practice and Assessment with MyProgrammingLab


MyProgrammingLab helps students fully grasp the logic, semantics, and syntax of program-
ming. Through practice exercises and immediate, personalized feedback, MyProgram-
mingLab improves the programming competence of beginning students who often struggle
with the basic concepts and paradigms of popular high-level programming languages.
A self-study and homework tool, a MyProgrammingLab course consists of hundreds of
small practice problems organized around the structure of this textbook. For students, the
system automatically detects errors in the logic and syntax of their code submissions and
offers targeted hints that enable students to gure out what went wrong and why. For
instructors, a comprehensive gradebook tracks correct and incorrect answers and stores the
code inputted by students for review.
MyProgrammingLab is offered to users of this book in partnership with Turing s Craft, the
makers of the CodeLab interactive programming exercise system. For a full demonstration,
to see feedback from instructors and students, or to get started using MyProgrammingLab
in your course, visit www.myprogramminglab.com.

Instructor Resources
The following supplements are available to quali ed instructors only:
Answers to all Review Questions in the text
Solutions for all Programming Challenges in the text
PowerPoint presentation slides for every chapter
Preface xxiii

Computerized test bank


Answers to all Student Lab Manual questions
Solutions for all Student Lab Manual programs
Visit the Pearson Instructor Resource Center (www.pearsonhighered.com/irc) or send an
email to [email protected] for information on how to access them.

Textbook Web site


Student and instructor resources, including links to download Microsoft® Visual C++
2010 Express and other popular IDEs, for all the books in the Gaddis Starting Out With
series can be accessed at the following URL:
http://www.pearsonhighered.com/gaddis

Get this book the way you want it!


This book is part of Pearson Education s custom database for Computer Science textbooks.
Use our online PubSelect system to select just the chapters you need from this, and other,
Pearson Education CS textbooks. You can edit the sequence to exactly match your course
organization and teaching approach. Visit www.pearsoncustom.com/cs for details.

Which Gaddis C++ book is right for you?


The Starting Out with C++ Series includes three books, one of which is sure to t your
course:
Starting Out with C++: From Control Structures through Objects
Starting Out with C++: Early Objects
Starting Out with C++: Brief Version.
The following chart will help you determine which book is right for your course.

FROM CONTROL STRUCTURES EARLY OBJECTS


THROUGH OBJECTS
BRIEF VERSION

LATE INTRODUCTION OF OBJECTS EARLIER INTRODUCTION OF OBJECTS


Classes are introduced in Chapter 13 of the standard Classes are introduced in Chapter 7, after control
text and Chapter 11 of the brief text, after control structures and functions, but before arrays and
structures, functions, arrays, and pointers. Advanced pointers. Their use is then integrated into the
OOP topics, such as inheritance and polymorphism, remainder of the text. Advanced OOP topics, such as
are covered in the following two chapters. inheritance and polymorphism, are covered in
Chapters 11 and 15.

INTRODUCTION OF DATA STRUCTURES AND INTRODUCTION OF DATA STRUCTURES AND


RECURSION RECURSION
Linked lists, stacks and queues, and binary trees are Linked lists, stacks and queues, and binary trees are
introduced in the nal chapters of the standard text. introduced in the nal chapters of the text, after the
Recursion is covered after stacks and queues, but chapter on recursion.
before binary trees. These topics are not covered in
the brief text, though it does have appendices dealing
with linked lists and recursion.
xxiv Preface

Acknowledgments
There have been many helping hands in the development and publication of this text. We
would like to thank the following faculty reviewers for their helpful suggestions and expertise.

Ahmad Abuhejleh Royce Curtis


University of Wisconsin, River Falls Western Wisconsin Technical College
David Akins Joseph DeLibero
El Camino College Arizona State University
Steve Allan Jeanne Douglas
Utah State University University of Vermont
Vicki Allan Michael Dowell
Utah State University Augusta State U
Karen M. Arlien William E. Duncan
Bismark State College Louisiana State University
Mary Astone Judy Etchison
Troy University Southern Methodist University
Ijaz A. Awan Dennis Fairclough
Savannah State University Utah Valley State College
Robert Baird Mark Fienup
Salt Lake Community College University of Northern Iowa
Don Biggerstaff Richard Flint
Fayetteville Technical Community College North Central College
Michael Bolton Ann Ford Tyson
Northeastern Oklahoma State University Florida State University
Bill Brown Jeanette Gibbons
Pikes Peak Community College South Dakota State University
Charles Cadenhead James Gifford
Richland Community College University of Wisconsin, Stevens Point
Randall Campbell Leon Gleiberman
Morningside College Touro College
Wayne Caruolo Barbara Guillott
Red Rocks Community College Louisiana State University
Cathi Chambley-Miller Ranette Halverson, Ph.D.
Aiken Technical College Midwestern State University
C.C. Chao Carol Hannahs
Jacksonville State University University of Kentucky
Joseph Chao Dennis Heckman
Bowling Green State University Portland Community College
Preface xxv

Ric Heishman James McGuffee


George Mason University Austin Community College
Michael Hennessy Dean Mellas
University of Oregon Cerritos College
Ilga Higbee Lisa Milkowski
Black Hawk College Milwaukee School of Engineering
Patricia Hines Marguerite Nedreberg
Brookdale Community College Youngstown State University
Mike Holland Lynne O Hanlon
Northern Virginia Community College Los Angeles Pierce College
Mary Hovik Frank Paiano
Lehigh Carbon Community College Southwestern Community College
Richard Hull Theresa Park
Lenoir-Rhyne College Texas State Technical College
Chris Kardaras Mark Parker
North Central College Shoreline Community College
Willard Keeling Tino Posillico
Blue Ridge Community College SUNY Farmingdale
A.J. Krygeris Frederick Pratter
Houston Community College Eastern Oregon University
Sheila Lancaster Susan L. Quick
Gadsden State Community College Penn State University
Ray Larson Alberto Ramon
Inver Hills Community College Diablo Valley College
Jennifer Li Bazlur Rasheed
Ohlone College Sault College of Applied Arts and Technology
Norman H. Liebling Farshad Ravanshad
San Jacinto College Bergen Community College
Zhu-qu Lu Dolly Samson
University of Maine, Presque Isle Weber State University
Heidar Malki Ruth Sapir
University of Houston SUNY Farmingdale
Debbie Mathews Jason Schatz
J. Sargeant Reynolds City College of San Francisco
Rick Matzen Dr. Sung Shin
Northeastern State University South Dakota State University
Robert McDonald Bari Siddique
East Stroudsburg University University of Texas at Brownsville
xxvi Preface

William Slater David Topham


Collin County Community College Ohlone College
Shep Smithline Robert Tureman
University of Minnesota Paul D. Camp Community College
Caroline St. Claire Arisa K. Ude
North Central College Richland College
Kirk Stephens Peter van der Goes
Southwestern Community College Rose State College
Cherie Stevens Stewart Venit
South Florida Community College California State University, Los Angeles
Dale Suggs Judy Walters
Campbell University North Central College
Mark Swanson John H. Whipple
Red Wing Technical College Northampton Community College
Ann Sudell Thorn Aurelia Williams
Del Mar College Norfolk State University
Martha Tillman Vida Winans
College of San Mateo Illinois Institute of Technology
Ralph Tomlinson
Iowa State University

I would like to thank my family for their love and support in all of my many projects. I
would also like to thank Christopher Rich for his assistance in this revision. I am
extremely fortunate to have Michael Hirsch as my editor, and Stephanie Sellinger as edito-
rial assistant. Michael s support and encouragement makes it a pleasure to write chapters
and meet deadlines. I am also fortunate to have Yez Alayan as marketing manager, and
Kathryn Ferranti as marketing coordinator. They do a great job getting my books out to
the academic community. I had a great production team led by Jeff Holcomb, Managing
Editor, and Marilyn Lloyd, Senior Production Project Manager. Thanks to you all!
Preface xxvii

About the Author


Tony Gaddis is the principal author of the Starting Out with series of textbooks. He has
nearly two decades of experience teaching computer science courses, primarily at Haywood
Community College. Tony is a highly acclaimed instructor who was previously selected as
the North Carolina Community College Teacher of the Year, and has received the Teaching
Excellence award from the National Institute for Staff and Organizational Development.
The Starting Out With series includes introductory textbooks covering Programming Logic
and Design, Alice, C++, JavaTM, Microsoft® Visual Basic®, Microsoft® Visual C#, and
Python, all published by Pearson Addison-Wesley.
CHAPTER

Introduction to Computers
1 and Programming

TOPICS

1.1 Why Program? 1.4 What Is a Program Made of?


1.2 Computer Systems: Hardware 1.5 Input, Processing, and Output
and Software 1.6 The Programming Process
1.3 Programs and Programming 1.7 Procedural and Object-Oriented
Languages Programming

1.1 Why Program?

CO NCE PT: Computers can do many different jobs because they are programmable.

Think about some of the different ways that people use computers. In school, students use
computers for tasks such as writing papers, searching for articles, sending e-mail, and par-
ticipating in online classes. At work, people use computers to analyze data, make presen-
tations, conduct business transactions, communicate with customers and coworkers,
control machines in manufacturing facilities, and do many other things. At home, people
use computers for tasks such as paying bills, shopping online, social networking, and play-
ing computer games. And don t forget that smart phones, iPods®, car navigation systems,
and many other devices are computers as well. The uses of computers are almost limitless
in our everyday lives.
Computers can do such a wide variety of things because they can be programmed. This
means that computers are not designed to do just one job, but any job that their programs
tell them to do. A program is a set of instructions that a computer follows to perform a
task. For example, Figure 1-1 shows screens using Microsoft Word and PowerPoint, two
commonly used programs.

1
2 Chapter 1 Introduction to Computers and Programming

Figure 1-1 A word processing program and a presentation program

Programs are commonly referred to as software. Software is essential to a computer because


without software, a computer can do nothing. All of the software that we use to make our
computers useful is created by individuals known as programmers or software developers. A
programmer, or software developer, is a person with the training and skills necessary to design,
create, and test computer programs. Computer programming is an exciting and rewarding
career. Today, you will nd programmers working in business, medicine, government, law
enforcement, agriculture, academics, entertainment, and almost every other eld.
Computer programming is both an art and a science. It is an art because every aspect of a
program should be carefully designed. Listed below are a few of the things that must be
designed for any real-world computer program:
The logical flow of the instructions
The mathematical procedures
The appearance of the screens
The way information is presented to the user
The program s user-friendliness
Manuals and other forms of written documentation
There is also a scienti c, or engineering, side to programming. Because programs rarely
work right the rst time they are written, a lot of testing, correction, and redesigning is
required. This demands patience and persistence from the programmer. Writing software
demands discipline as well. Programmers must learn special languages like C++ because
computers do not understand English or other human languages. Languages such as C++
have strict rules that must be carefully followed.
Both the artistic and scienti c nature of programming make writing computer software
like designing a car: Both cars and programs should be functional, ef cient, powerful, easy
to use, and pleasing to look at.
1.2 Computer Systems: Hardware and Software 3

1.2 Computer Systems: Hardware and Software

CON CE PT: All computer systems consist of similar hardware devices and software
components. This section provides an overview of standard computer
hardware and software organization.

Hardware
Hardware refers to the physical components that a computer is made of. A computer, as
we generally think of it, is not an individual device, but a system of devices. Like the
instruments in a symphony orchestra, each device plays its own part. A typical computer
system consists of the following major components:
1. The central processing unit (CPU)
2. Main memory
3. Secondary storage devices
4. Input devices
5. Output devices
The organization of a computer system is depicted in Figure 1-2.

Figure 1-2

Central Processing
Unit

Output
Devices

Input
Devices

Main Memory
(RAM)

Secondary
Storage Devices
4 Chapter 1 Introduction to Computers and Programming

The CPU
When a computer is performing the tasks that a program tells it to do, we say that the com-
puter is running or executing the program. The central processing unit, or CPU, is the part
of a computer that actually runs programs. The CPU is the most important component in a
computer because without it, the computer could not run software.
In the earliest computers, CPUs were huge devices that weighed tons. They were made of
electrical and mechanical components such as vacuum tubes and switches. Today, CPUs are
small chips, known as microprocessors, that can be held in the palm of your hand. In addi-
tion to being much smaller than the old electromechanical CPUs in early computers, today s
microprocessors are also much more powerful.
The CPU s job is to fetch instructions, follow the instructions, and produce some result.
Internally, the central processing unit consists of two parts: the control unit and the arith-
metic and logic unit (ALU). The control unit coordinates all of the computer s operations. It
is responsible for determining where to get the next instruction and regulating the other
major components of the computer with control signals. The arithmetic and logic unit, as its
name suggests, is designed to perform mathematical operations. The organization of the
CPU is shown in Figure 1-3.

Figure 1-3

Central Processing Unit

Arithmetic and
Logic Unit
Instruction Result
(Input) (Output)

Control Unit

A program is a sequence of instructions stored in the computer s memory. When a com-


puter is running a program, the CPU is engaged in a process known formally as the fetch/
decode/execute cycle. The steps in the fetch/decode/execute cycle are as follows:
Fetch The CPU s control unit fetches, from main memory, the next instruc-
tion in the sequence of program instructions.
Decode The instruction is encoded in the form of a number. The control unit
decodes the instruction and generates an electronic signal.
Execute The signal is routed to the appropriate component of the computer
(such as the ALU, a disk drive, or some other device). The signal causes
the component to perform an operation.
These steps are repeated as long as there are instructions to perform.
1.2 Computer Systems: Hardware and Software 5

Main Memory
You can think of main memory as the computer s work area. This is where the computer
stores a program while the program is running, as well as the data that the program is
working with. For example, suppose you are using a word processing program to write an
essay for one of your classes. While you do this, both the word processing program and
the essay are stored in main memory.
Main memory is commonly known as random-access memory or RAM. It is called this
because the CPU is able to quickly access data stored at any random location in RAM.
RAM is usually a volatile type of memory that is used only for temporary storage while a
program is running. When the computer is turned off, the contents of RAM are erased.
Inside your computer, RAM is stored in small chips.
A computer s memory is divided into tiny storage locations known as bytes. One byte is
enough memory to store only a letter of the alphabet or a small number. In order to do
anything meaningful, a computer must have lots of bytes. Most computers today have
millions, or even billions, of bytes of memory.
Each byte is divided into eight smaller storage locations known as bits. The term bit
stands for binary digit. Computer scientists usually think of bits as tiny switches that can
be either on or off. Bits aren t actual switches, however, at least not in the conventional
sense. In most computer systems, bits are tiny electrical components that can hold either a
positive or a negative charge. Computer scientists think of a positive charge as a switch in
the on position and a negative charge as a switch in the off position.
Each byte is assigned a unique number known as an address. The addresses are ordered
from lowest to highest. A byte is identi ed by its address in much the same way a post
of ce box is identi ed by an address. Figure 1-4 shows a group of memory cells with their
addresses. In the illustration, sample data is stored in memory. The number 149 is stored
in the cell with the address 16, and the number 72 is stored at address 23.

Figure 1-4

0 1 2 3 4 5 6 7 8 9

10 11 12 13 14 15 16 17 18 19
149

20 21 22 23 24 25 26 27 28 29
72

Secondary Storage
Secondary storage is a type of memory that can hold data for long periods of time even
when there is no power to the computer. Frequently used programs are stored in second-
ary memory and loaded into main memory as needed. Important information, such as
word processing documents, payroll data, and inventory gures, is saved to secondary
storage as well.
The most common type of secondary storage device is the disk drive. A disk drive stores
data by magnetically encoding it onto a circular disk. Most computers have a disk drive
mounted inside their case. External disk drives, which connect to one of the computer s
6 Chapter 1 Introduction to Computers and Programming

communication ports, are also available. External disk drives can be used to create backup
copies of important data or to move data to another computer.
In addition to external disk drives, many types of devices have been created for copying
data, and for moving it to other computers. For many years oppy disk drives were popu-
lar. A oppy disk drive records data onto a small oppy disk, which can be removed from
the drive. The use of oppy disk drives has declined dramatically in recent years, in favor
of superior devices such as USB drives. USB drives are small devices that plug into the
computer s USB (universal serial bus) port, and appear to the system as a disk drive. USB
drives, which use ash memory to store data, are inexpensive, reliable, and small enough
to be carried in your pocket.
Optical devices such as the CD (compact disc) and the DVD (digital versatile disc) are
also popular for data storage. Data is not recorded magnetically on an optical disc, but is
encoded as a series of pits on the disc surface. CD and DVD drives use a laser to detect the
pits and thus read the encoded data. Optical discs hold large amounts of data, and
because recordable CD and DVD drives are now commonplace, they are good mediums
for creating backup copies of data.

Input Devices
Input is any information the computer collects from the outside world. The device that
collects the information and sends it to the computer is called an input device. Common
input devices are the keyboard, mouse, scanner, digital camera, and microphone. Disk
drives, CD/DVD drives, and USB drives can also be considered input devices because pro-
grams and information are retrieved from them and loaded into the computer s memory.

Output Devices
Output is any information the computer sends to the outside world. It might be a sales
report, a list of names, or a graphic image. The information is sent to an output device,
which formats and presents it. Common output devices are monitors, printers, and speak-
ers. Output sent to a monitor is sometimes called softcopy, while output sent to a
printer is called hardcopy. Disk drives, USB drives, and CD/DVD recorders can also be
considered output devices because the CPU sends them information to be saved.

Software
If a computer is to function, software is not optional. Everything that a computer does,
from the time you turn the power switch on until you shut the system down, is under the
control of software. There are two general categories of software: system software and
application software. Most computer programs clearly t into one of these two categories.
Let s take a closer look at each.
1.2 Computer Systems: Hardware and Software 7

System Software
The programs that control and manage the basic operations of a computer are generally
referred to as system software. System software typically includes the following types of
programs:
Operating Systems
An operating system is the most fundamental set of programs on a computer. The
operating system controls the internal operations of the computer s hardware, man-
ages all the devices connected to the computer, allows data to be saved to and
retrieved from storage devices, and allows other programs to run on the computer.
Utility Programs
A utility program performs a specialized task that enhances the computer s
operation or safeguards data. Examples of utility programs are virus scanners,
file-compression programs, and data-backup programs.
Software Development Tools
The software tools that programmers use to create, modify, and test software are
referred to as software development tools. Compilers and integrated development
environments, which we discuss later in this chapter, are examples of programs
that fall into this category.

Application Software
Programs that make a computer useful for everyday tasks are known as application
software. These are the programs that people normally spend most of their time running
on their computers. Figure 1-1, at the beginning of this chapter, shows screens from two
commonly used applications Microsoft Word, a word processing program, and Microsoft
PowerPoint, a presentation program. Some other examples of application software are
spreadsheet programs, e-mail programs, Web browsers, and game programs.

Checkpoint
www.myprogramminglab.com

1.1 Why is the computer used by so many different people, in so many different
professions?
1.2 List the ve major hardware components of a computer system.
1.3 Internally, the CPU consists of what two units?
1.4 Describe the steps in the fetch/decode/execute cycle.
1.5 What is a memory address? What is its purpose?
1.6 Explain why computers have both main memory and secondary storage.
1.7 What are the two general categories of software?
1.8 What fundamental set of programs control the internal operations of the
computer s hardware?
1.9 What do you call a program that performs a specialized task, such as a virus
scanner, a le-compression program, or a data-backup program?
1.10 Word processing programs, spreadsheet programs, e-mail programs, Web browsers,
and game programs belong to what category of software?
8 Chapter 1 Introduction to Computers and Programming

1.3 Programs and Programming Languages

C ON CE PT: A program is a set of instructions a computer follows in order to perform


a task. A programming language is a special language used to write
computer programs.

What Is a Program?
Computers are designed to follow instructions. A computer program is a set of instruc-
tions that tells the computer how to solve a problem or perform a task. For example, sup-
pose we want the computer to calculate someone s gross pay. Here is a list of things the
computer should do:
1. Display a message on the screen asking How many hours did you work?
2. Wait for the user to enter the number of hours worked. Once the user enters a
number, store it in memory.
3. Display a message on the screen asking How much do you get paid per hour?
4. Wait for the user to enter an hourly pay rate. Once the user enters a number, store it in
memory.
5. Multiply the number of hours by the amount paid per hour, and store the result in
memory.
6. Display a message on the screen that tells the amount of money earned. The message
must include the result of the calculation performed in Step 5.
Collectively, these instructions are called an algorithm. An algorithm is a set of well-
de ned steps for performing a task or solving a problem. Notice these steps are sequen-
tially ordered. Step 1 should be performed before Step 2, and so forth. It is important that
these instructions be performed in their proper sequence.
Although you and I might easily understand the instructions in the pay-calculating algo-
rithm, it is not ready to be executed on a computer. A computer s CPU can only process
instructions that are written in machine language. If you were to look at a machine lan-
guage program, you would see a stream of binary numbers (numbers consisting of only 1s
and 0s). The binary numbers form machine language instructions, which the CPU inter-
prets as commands. Here is an example of what a machine language instruction might
look like:
1011010000000101

As you can imagine, the process of encoding an algorithm in machine language is very
tedious and dif cult. In addition, each different type of CPU has its own machine lan-
guage. If you wrote a machine language program for computer A and then wanted to run
it on computer B, which has a different type of CPU, you would have to rewrite the pro-
gram in computer B s machine language.
Programming languages, which use words instead of numbers, were invented to ease the task
of programming. A program can be written in a programming language, such as C++, which
is much easier to understand than machine language. Programmers save their programs in
text les, and then use special software to convert their programs to machine language.
1.3 Programs and Programming Languages 9

Program 1-1 shows how the pay-calculating algorithm might be written in C++.
The Program Output with Example Input shows what the program will display on the
screen when it is running. In the example, the user enters 10 for the number of hours
worked and 15 for the hourly pay rate. The program displays the earnings, which are $150.

N O TE: The line numbers that are shown in Program 1-1 are not part of the program.
This book shows line numbers in all program listings to help point out speci c parts of
the program.

Program 1-1

1 // This program calculates the user's pay.


2 #include <iostream>
3 using namespace std;
4
5 int main()
6 {
7 double hours, rate, pay;
8
9 // Get the number of hours worked.
10 cout << "How many hours did you work? ";
11 cin >> hours;
12
13 // Get the hourly pay rate.
14 cout << "How much do you get paid per hour? ";
15 cin >> rate;
16
17 // Calculate the pay.
18 pay = hours * rate;
19
20 // Display the pay.
21 cout << "You have earned $" << pay << endl;
22 return 0;
23 }

Program Output with Example Input Shown in Bold


How many hours did you work? 10 [Enter]
How much do you get paid per hour? 15 [Enter]
You have earned $150

Programming Languages
In a broad sense, there are two categories of programming languages: low-level and
high-level. A low-level language is close to the level of the computer, which means it
resembles the numeric machine language of the computer more than the natural lan-
guage of humans. The easiest languages for people to learn are high-level languages.
They are called high-level because they are closer to the level of human-readability
than computer-readability. Figure 1-5 illustrates the concept of language levels.
Many high-level languages have been created. Table 1-1 lists a few of the well-known ones.
In addition to the high-level features necessary for writing applications such as payroll
systems and inventory programs, C++ also has many low-level features. C++ is based on
10 Chapter 1 Introduction to Computers and Programming

Figure 1-5

High level (Easily read by humans)


cout <<
"Enter
cout << the num
"of hou ber
cin >> rs worked ";
hours; : ";
cout <<
"Enter
cout << the hou
"pay rat rly ";
cin >> e: ";
payRat e;

Low level (machine language)


10100010 11101011

Table 1-1
Language Description
BASIC Beginners All-purpose Symbolic Instruction Code. A general programming language
originally designed to be simple enough for beginners to learn.
FORTRAN Formula Translator. A language designed for programming complex mathematical
algorithms.
COBOL Common Business-Oriented Language. A language designed for business applications.
Pascal A structured, general-purpose language designed primarily for teaching programming.
C A structured, general-purpose language developed at Bell Laboratories. C offers both
high-level and low-level features.
C++ Based on the C language, C++ offers object-oriented features not found in C. Also
invented at Bell Laboratories.
C# Pronounced C sharp. A language invented by Microsoft for developing applications
based on the Microsoft .NET platform.
Java An object-oriented language invented at Sun Microsystems. Java may be used to
develop programs that run over the Internet, in a Web browser.
JavaScript JavaScript can be used to write small programs that run in Web pages. Despite its name,
JavaScript is not related to Java.
Python Python is a general purpose language created in the early 1990s. It has become popular
in both business and academic applications.
Ruby Ruby is a general purpose language that was created in the 1990s. It is increasingly
becoming a popular language for programs that run on Web servers.
Visual A Microsoft programming language and software development environment that
Basic allows programmers to quickly create Windows-based applications.
1.3 Programs and Programming Languages 11

the C language, which was invented for purposes such as writing operating systems and
compilers. Since C++ evolved from C, it carries all of C s low-level capabilities with it.
C++ is popular not only because of its mixture of low- and high-level features, but also
because of its portability. This means that a C++ program can be written on one type of
computer and then run on many other types of systems. This usually requires the pro-
gram to be recompiled on each type of system, but the program itself may need little or
no change.

NO TE: Programs written for speci c graphical environments often require signi cant
changes when moved to a different type of system. Examples of such graphical
environments are Windows, the X-Window System, and the Mac OS operating system.

Source Code, Object Code, and Executable Code


When a C++ program is written, it must be typed into the computer and saved to a le. A
text editor, which is similar to a word processing program, is used for this task. The state-
ments written by the programmer are called source code, and the le they are saved in is
called the source le.
After the source code is saved to a le, the process of translating it to machine language
can begin. During the rst phase of this process, a program called the preprocessor reads
the source code. The preprocessor searches for special lines that begin with the # symbol.
These lines contain commands that cause the preprocessor to modify the source code in
some way. During the next phase the compiler steps through the preprocessed source
code, translating each source code instruction into the appropriate machine language
instruction. This process will uncover any syntax errors that may be in the program. Syn-
tax errors are illegal uses of key words, operators, punctuation, and other language ele-
ments. If the program is free of syntax errors, the compiler stores the translated machine
language instructions, which are called object code, in an object le.
Although an object le contains machine language instructions, it is not a complete pro-
gram. Here is why: C++ is conveniently equipped with a library of prewritten code for per-
forming common operations or sometimes-dif cult tasks. For example, the library contains
hardware-speci c code for displaying messages on the screen and reading input from the
keyboard. It also provides routines for mathematical functions, such as calculating the
square root of a number. This collection of code, called the run-time library, is extensive.
Programs almost always use some part of it. When the compiler generates an object le,
however, it does not include machine code for any run-time library routines the programmer
might have used. During the last phase of the translation process, another program called
the linker combines the object le with the necessary library routines. Once the linker has
nished with this step, an executable le is created. The executable le contains machine
language instructions, or executable code, and is ready to run on the computer.
Figure 1-6 illustrates the process of translating a C++ source le into an executable le.
The entire process of invoking the preprocessor, compiler, and linker can be initiated with
a single action. For example, on a Linux system, the following command causes the C++
program named hello.cpp to be preprocessed, compiled, and linked. The executable
code is stored in a le named hello.
g++ -o hello hello.cpp
12 Chapter 1 Introduction to Computers and Programming

Figure 1-6

Source Code Source code is entered


with a text editor by
the programmer.

#include <iostream>
using namespace std;
Preprocessor
int main()
{
cout<<"Hello World\n";
Modified return 0;
Source Code }

Compiler

Object Code

Linker

Executable Code

Appendix G explains how compiling works in .Net. You can download Appendix G from
the book s companion Web site at www.pearsonhighered.com/gaddis.

Many development systems, particularly those on personal computers, have integrated


development environments (IDEs). These environments consist of a text editor, compiler,
debugger, and other utilities integrated into a package with a single set of menus. Prepro-
cessing, compiling, linking, and even executing a program is done with a single click of a
button, or by selecting a single item from a menu. Figure 1-7 shows a screen from the
Microsoft Visual Studio IDE.

Checkpoint
www.myprogramminglab.com

1.11 What is an algorithm?


1.12 Why were computer programming languages invented?
1.13 What is the difference between a high-level language and a low-level language?
1.14 What does portability mean?
1.15 Explain the operations carried out by the preprocessor, compiler, and linker.
1.16 Explain what is stored in a source le, an object le, and an executable le.
1.17 What is an integrated development environment?
Exploring the Variety of Random
Documents with Different Content
The Project Gutenberg eBook of A history of
the University of Oxford
This ebook is for the use of anyone anywhere in the United States
and most other parts of the world at no cost and with almost no
restrictions whatsoever. You may copy it, give it away or re-use it
under the terms of the Project Gutenberg License included with this
ebook or online at www.gutenberg.org. If you are not located in the
United States, you will have to check the laws of the country where
you are located before using this eBook.

Title: A history of the University of Oxford

Author: George C. Brodrick

Release date: January 15, 2024 [eBook #72729]

Language: English

Original publication: London: Longmans, Green, and Co, 1900

Credits: Bob Taylor, MWS and the Online Distributed Proofreading


Team at https://www.pgdp.net (This file was produced from
images generously made available by The Internet
Archive/Canadian Libraries)

*** START OF THE PROJECT GUTENBERG EBOOK A HISTORY


OF THE UNIVERSITY OF OXFORD ***
Epochs of Church History
EDITED BY

MANDELL CREIGHTON, D.D., LL.D.


BISHOP OF LONDON

THE

UNIVERSITY OF OXFORD
Epochs of Church
History.
Edited by MANDELL CREIGHTON, D.D., LL.D.,
BISHOP OF LONDON.

Fcap. 8vo, price 2s. 6d. each.


THE ENGLISH CHURCH IN OTHER LANDS. By
the Rev. H. W. Tucker, M.A.
THE HISTORY OF THE REFORMATION IN
ENGLAND. By the Rev. George G. Perry, M.A.
THE CHURCH OF THE EARLY FATHERS. By
Alfred Plummer, D.D.

THE EVANGELICAL REVIVAL IN THE


EIGHTEENTH CENTURY. By the Rev. J. H.
Overton, D.D.
A HISTORY OF THE UNIVERSITY OF OXFORD.
By the Hon. G. C. Brodrick, D.C.L.
A HISTORY OF THE UNIVERSITY OF
CAMBRIDGE. By J. Bass Mullinger, M.A.
THE CHURCH AND THE ROMAN EMPIRE. By the
Rev. A. Carr, M.A.
THE CHURCH AND THE PURITANS, 1570-1660.
By Henry Offley Wakeman, M.A.
THE CHURCH AND THE EASTERN EMPIRE. By
the Rev. H. F. Tozer, M.A.

HILDEBRAND AND HIS TIMES. By W. R. W.


Stephens, B.D.
THE ENGLISH CHURCH IN THE MIDDLE AGES.
By the Rev. W. Hunt, M.A.
THE POPES AND THE HOHENSTAUFEN. By Ugo
Balzani.
THE COUNTER-REFORMATION. By A. W. Ward,
Litt.D.
WYCLIFFE AND MOVEMENTS FOR REFORM.
By R. L. Poole, M.A., Ph.D.

THE ARIAN CONTROVERSY. By H. M. Gwatkin,


M.A.

LONGMANS, GREEN, AND CO.


LONDON, NEW YORK, AND BOMBAY
A HISTORY

OF THE

UNIVERSITY OF OXFORD

BY THE

HON. G. C. BRODRICK, D.C.L.

WARDEN OF MERTON COLLEGE

FOURTH IMPRESSION

LONGMANS, GREEN, AND CO.


39 PATERNOSTER ROW, LONDON
NEW YORK AND BOMBAY
1900

All rights reserved


PREFACE.

The present volume is an attempt to present in a succinct form the


history of an University which, however uncertain its origin, is among
the oldest institutions in Europe. The result of such a task must
needs fall very far short of perfection, and it is probably a just
appreciation of its difficulties which has deterred abler historians
from undertaking it. The voluminous remains of Anthony Wood
contain a mine of precious records, but they are singularly ill-
arranged, and his narrative breaks off long before the end of the
seventeenth century. The great monograph of Father Denifle, now in
course of publication, on the early history of European Universities,
promises to be an exhaustive discussion of its subject; but its
enormous bulk and unwieldy construction will repel most English
readers, while it deals only with the rudimentary development of
academical constitutions. The well-known compilation of Huber
shows considerable research and grasp of the subject, but it follows
no historical order, and is disfigured by much irrelevance and
prejudice. The publications of the Oxford Historical Society have
already placed documents hitherto scarcely accessible within the
reach of ordinary students, but it will be long before the series can be
completed. All these works, as well as the valuable ‘Munimenta
Academica’ of Mr. Anstey, Professor Burrows’ ‘Visitors’ Register,’
and many other treatises of less note, have been freely consulted by
me. I have also made use of the Merton College Register, which has
been kept with few interruptions since the year 1482, and of other
MSS. documents in the possession of my own College. But I have
not thought it well to encumber the pages of so compendious a
narrative with constant references to authorities. My principal aim
has been to exhibit the various features and incidents of University
history, age by age, in their due proportion; dwelling more upon
broad and undisputed facts than upon comparatively obscure points
which are the natural field of antiquarian speculation or criticism.
Guided by a similar principle, I have not treated all periods of
University history with equal detail. Thus, I have devoted a large
share of space to the period of the Civil Wars, during which the
University played a great part in the national drama; while I have
passed lightly over the reign of George III., when the University had
not only lost all political importance, but had forfeited its reputation
as a place of the highest education and learning. In the selection of
topics from so vast a mass of materials, I have sought to preserve
the continuity of events, so far as possible, rather than to produce a
series of essays on special aspects of University life. I have
deviated, however, from this method in one or two instances, such
as the chapter on Oxford politics in the eighteenth century, and that
on the Neo-Catholic Revival. In several of the earlier chapters, and in
those on Oxford in the present century, I have borrowed the
substance of passages from my own volume, ‘Memorials of Merton
College,’ and from articles on recent University reforms contributed
by myself to various periodicals. If I have succeeded in bringing
within a single view the successive phases of development through
which the University has passed in the course of seven hundred
years, and in paving the way for a more comprehensive and detailed
history, the object of this little volume will have been attained.
George C. Brodrick.
CONTENTS.

PAGE
eface v

CHAPTER I.
THE RISE OF THE UNIVERSITY.
thical origin of the University—Early Schools of Oxford—
Intellectual revival of the twelfth century—Lectures of Vacarius,
and first germs of the University—Connection of Oxford with the
University of Paris—Recognition of the scholars by the Papal 1
Legate after the riot of 1209—Office of Chancellor—University
chests, and sources of revenue in the thirteenth century—Rise
of Halls—Early University charters

CHAPTER II.
THE EARLY COLLEGES.
e of Colleges—Foundation of University and Balliol—Foundation
of Merton College—Merton College, Statutes of, 1274—Social
position, manners, and academical life of early students 15
—‘Chamber-dekyns’—Street brawls and disorders—Superiority
of colleges in discipline and tuition

CHAPTER III.
PROGRESS OF THE UNIVERSITY IN THE
FOURTEENTH CENTURY.
ope in the fourteenth century—Social condition of the University 27
—Intellectual vigour of the University—Foundation of Exeter,
Oriel, Queen’s, and Canterbury Colleges—Foundation of New
College—European influence of Oxford in the fourteenth
century—Rise of Wyclif—Career of Wyclif—Feud between
Northern and Southern ‘nations’—Early secessions to
Cambridge and Northampton—Secession to Stamford in 1333
—Growth of the proctorial authority—Concession by the Pope
of freedom in the election of the Chancellor

CHAPTER IV.
CONFLICTS BETWEEN THE UNIVERSITY AND THE CITY.
yal award of 1290—Riot of 1297 and agreement of 1298—Great
riot of 1354—Interdict and penance—New charter granted by 43
the King

CHAPTER V.
THE MONKS AND FRIARS AT OXFORD.
nedictines and Augustinians—Rise of Mendicant Orders—
Claustral schools—Migration from Paris and influence of Robert
48
Grostete—Position of the friars at Oxford, and University
statutes against them—Intervention of the Pope and the King

CHAPTER VI.
THE UNIVERSITY IN THE FIFTEENTH CENTURY.
cline in numbers and studies—University delegates at the
Councils of Constance and Basle—Foundation of Lincoln and
All Souls’ Colleges—Extension of University buildings; the
Divinity School and the Bodleian Library—Final organisation of 55
mediæval lectures and examinations—University curriculum—
Statute of 1431, regulating ‘inception’—Duties of regent
masters—Residence for degrees in the higher faculties

CHAPTER VII.
THE RENAISSANCE, THE REFORMATION, AND
THE TUDOR PERIOD.
vival of academical life at the end of the fifteenth century— 68
Checked by the Reformation—Pioneers of the new learning at
Oxford—Erasmus, More, Colet, Grocyn, and Linacre—
Foundation of Corpus Christi College by Bishop Fox—Greeks
and Trojans—Cardinal Wolsey and the foundation of Christ
Church—Action of the University on the questions of the
Divorce and the Royal Supremacy—Compliance of the
University rewarded by royal favour—The first effects of the
Reformation injurious to the University—Iconoclastic Visitation
under Edward VI.—Leniency towards colleges—Reaction under
Mary. Martyrdom of Ridley, Latimer, and Cranmer—Visitation
and reforms of Cardinal Pole—Foundation of Trinity and St.
John’s Colleges

CHAPTER VIII.
REIGN OF ELIZABETH AND CHANCELLORSHIP
OF LEICESTER.
tation under Elizabeth and policy of Archbishop Parker—
Chancellorship of Leicester—Changes in the government of the
University—Leicester’s administration of the University—
Depression of intellectual life in the University—Encouragement
87
of study by Elizabeth, and foundation of the Bodleian Library—
Increasing refinement of academical life—Queen Elizabeth’s
two visits to Oxford—Pestilences and disturbances in the
sixteenth century

CHAPTER IX.
THE UNIVERSITY UNDER JAMES I.
e University patronised by James I.—James I.’s attitude towards
the University and the Church—Rise and influence of Laud—
100
Completion of the ‘Schools,’ and foundation of Wadham and
Pembroke Colleges

CHAPTER X.
THE UNIVERSITY UNDER CHARLES I. AND LAUD.
liament at Oxford—Chancellorship of Laud—Compilation of 107
Laudian statutes—Main provisions of the Laudian statutes—
Studies and examinations under the Laudian statutes—
Services of Laud to the University—Last five years of Laud’s
chancellorship—Eminent members of the University in the
generation preceding the Civil Wars—University life in the
generation preceding the Civil Wars

CHAPTER XI.
THE UNIVERSITY DURING THE CIVIL WARS AND THE
SIEGE OF OXFORD.
e University sides with the King and the Church—The Commons
issue an order for the University—Contributions for the King’s
service, and first occupation of Oxford by Parliamentary troops
—Oxford becomes the royal head-quarters—Aspect of the
122
University during the Queen’s residence—The last two years of
the civil war—Siege of Oxford, and proposals of Fairfax
guaranteeing University privileges—Surrender of Oxford, and
subsequent condition of the University

CHAPTER XII.
THE PARLIAMENTARY VISITATION AND THE
COMMONWEALTH.
asures preparatory to the Visitation—Appointment of the Visitors
and the Standing Committee of Parliament—Early proceedings
of the Visitors, and suppression of resistance from the
University—Visitation of colleges. Submissions and expulsions
138
—Reception of Fairfax and Cromwell—Second Board of
Visitors—Third Board of Visitors, and conclusion of the
Visitation—State of the University on the recovery of its
independence

CHAPTER XIII.
THE PERIOD BETWEEN THE RESTORATION AND
THE REVOLUTION.
e Restoration and new Visitation of the University—Extension of
University buildings. Sheldonian Theatre—Growth of æsthetic
tastes and social refinement—First visit of Charles II.—Second
visit of Charles II. Parliament assembled and dissolved at
151
Oxford—Doctrine of passive resistance adopted by the
University. Expulsion of Locke—Conduct of the University on
the outbreak of Monmouth’s rebellion. James II.’s treatment of
Magdalen College

CHAPTER XIV.
UNIVERSITY POLITICS BETWEEN THE REVOLUTION
AND THE ACCESSION OF GEORGE III.
tude of the University towards the Revolution. Visit of William III.
—Origin of Oxford Jacobitism. Visit of Queen Anne—Popularity
of Sacheverell. Position of the Whig minority—Jacobite
demonstrations. A troop of horse sent to Oxford—The
162
Constitution Club. Government scheme for reforming the
University—Gradual decline of Jacobitism in Oxford during the
reign of George II.—Revival of loyalty after the accession of
George III.—His visits to Oxford

CHAPTER XV.
UNIVERSITY STUDIES IN THE EIGHTEENTH CENTURY.
cay of University education in the eighteenth century—
Contemporary evidence—Decline in numbers and dearth of
174
eminence in science and literature—Counter-evidence showing
that education and learning were not wholly neglected

CHAPTER XVI.
THE UNIVERSITY DURING THE REIGNS OF GEORGE III.
AND GEORGE IV.
gnation of University legislation in the eighteenth century— 183
Statutes affecting the University—Political sympathies of the
University after the outbreak of the French Revolution—
Accessions to professoriate in the eighteenth century—
Architectural improvements—Effects of the French war upon
the University.—Opposition to reforms—Reception of the Allied
Sovereigns.—Abolition of the Mayor’s Oath

CHAPTER XVII.
OXFORD STUDIES AND EXAMINATIONS IN THE
NINETEENTH CENTURY.
amination statute of 1800, and later amendments—Examination
statute of 1850, and later amendments—University
Commission of 1850—Act of 1854 and new College
Ordinances—Effect of these reforms—Abolition of University 191
tests—Local examinations, and board for examination of public
schools—Commission of inquiry (1872) and Act of 1876—
Commission of 1877—Character of last reforms

CHAPTER XVIII.
THE NEO-CATHOLIC REVIVAL, KNOWN AS THE ‘OXFORD
MOVEMENT.’
aracter of the ‘Oxford Movement’—A reaction against the rising
tide of Liberalism—Oriel the centre of the Movement—John
Henry Newman—Origin of ‘Tracts for the Times’—Association
formed—Newman assumes the lead—Spread and objects of
the movement.—Publication of Tract XC.—Collapse of 204
Tractarianism, and secession of Newman—The ‘Hampden
Controversy’—Proceedings against Pusey and Ward—Effect of
the ‘Oxford Movement’—Controversy on the endowment of the
Greek Professorship.—Defeat of Mr. Gladstone in 1865

CHAPTER XIX.
THE UNIVERSITY IN 1886.
gn of Queen Victoria—State of the University on the Queen’s
accession—Influence of recent changes—Present character of 217
the University

DEX 223
THE UNIVERSITY OF OXFORD.
CHAPTER I.
THE RISE OF THE UNIVERSITY.

The University of Oxford has long ceased to claim


Mythical origin the fabulous antiquity for which its mediæval
of the University champions had contended, as for an article of
faith, and which found credit with so conscientious
an historian as Anthony Wood. It is now admitted that nothing is
certainly known of its origin, and that its alleged foundation by Alfred
the Great rests upon a tradition which cannot be traced back to a
period beyond the fourteenth century. There is no evidence whatever
to show that any germ of a University, much less that any college,
existed at Oxford in the reign of Alfred, who was born in the
neighbouring town of Wantage. The very contrary may reasonably
be inferred from the negative fact that Asser, in his contemporary
biography of Alfred, makes no allusion to his supposed institution of
‘schools’ at Oxford, though he amply attests his paternal zeal for
English education. The early chroniclers are, without exception,
equally silent on the subject, which is noticed by no extant writer
before the age of Edward III. In the next reign, the primary myth—for
so we must regard it—was developed into a secondary myth,
attributing to Alfred the foundation of University College, and this
imaginary pretension was actually advanced by that college in the
course of a lawsuit. Meanwhile, the simpler tradition of Alfred’s
connection with the University Schools was repeated by author after
author in days when the very nature of historical proof was unknown,
and was reinforced in the sixteenth century by the insertion of a
spurious passage into the work of Asser. It has been reserved for the
present century to recognise the plain truth that we are entirely
ignorant of the first stage in the growth of the University, and that its
name is never mentioned in history before the Norman Conquest.
The silence of Domesday Book respecting the University of Oxford
must be taken as presumptive, though by no means conclusive,
proof that it had no corporate existence at that
Early schools of date. Much learning has been spent in
Oxford speculations on its origin and primitive constitution,
but these speculations have little support in any
facts historically known to us before the Norman Conquest. It is more
than probable, however, that Oxford was already a resort of students
and a place of education. Having been a residence of Edmund
Ironside, Canute, and Harold I., as well as the seat of several
National Councils, it was now recognised as a provincial capital by
the erection of its castle, embracing within it the Collegiate Church of
St. George; while the number of its monastic establishments would
naturally attract poor scholars from all parts of England. The earliest
schools, not in England only but throughout Europe, were attached
to monasteries or cathedrals; and, in the absence of any contrary
evidence, analogy almost compels us to regard the Church as the
foster-mother of the University. In the ‘claustral’ schools of St.
Frideswide, and the houses in Oxford belonging to abbeys, such as
those of Abingdon and Eynsham, we may discern the original
seminaries of academical teaching—the first rudiments of the
Studium Generale, afterwards developed into the Universitas
Literaria. On the other hand, it is certain that, side by side with these
claustral schools, secular or lay schools were gradually opened—
some boarding-schools, mainly designed for the reception of boys
from the country, others mere classrooms frequented by the students
who lodged either in private dwellings or in public hostels. It appears
that before long the secular outnumbered the claustral schools, and
became centred in a particular quarter of the city, stretching
northward from the west end of St. Mary’s Church, afterwards known
as School Street, and said to have existed in the year 1109. We may
surmise with some confidence that in the infancy of the University its
lecturers were almost exclusively clerks, but too often scholastic
adventurers of mean attainments, whose lessons rose little above
the barest elements of knowledge. But all theories of its rudimentary
organisation are purely conjectural. ‘The Schools of Oxford’ first
emerge into history in the next century, when they really attained a
national celebrity, soon eclipsing those of Canterbury, Winchester,
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookfinal.com

You might also like