Holt Software Books [Graphical Version] | [Printer Friendly Version]
![[Cover of Book]](img/prog_concept_paradigm.gif) |
Programming: Concepts and Paradigms
|
| Title: |
Programming: Concepts and Paradigms (First Edition) |
| Author: |
J.N.P. Hume and D.T. Barnard |
| ISBN: |
0-921598-27-0 |
| Publisher: |
Holt Software Associates Inc. |
| Binding: |
Softcover |
| Pages: |
434 pgs |
| Price: |
Bookstores & Schools: $33.00 Retail: $41.25 |
| Ordering Information: |
For bookstores and schools, click here for
ordering information. For individuals click
here for ordering information. |
| Program Examples: |
Available [Click here for
information on obtaining program examples found in Holt Software
publications.] |
| Solutions Manual: |
Available [Click here for
information on obtaining Solutions Manuals for Holt Software
publications.] |
Designed for Grade 12 in high schools and for a first course in
computer science in colleges and universities, this is the first
textbook produces by Holt Software written for use with Object
Oriented Turing.
It emphasizes the basic concepts of programming and presents, in parallel,
the two principal paradigms for structuring programs: the procedure-oriented
paradigm and the object-oriented paradigm. This approach is intended to
help students understand both paradigms and to move more easily between
them. The computer concepts covered include: input of data, control
constructs, procedures, functions, object, classes and inheritance,
arrays, records, unions and sets, algorithms for sorting, pointers
and linked lists, and trees.
Preface to Programming: Concepts and Paradigms (First Edition)
This textbook, Programming: Concepts and Paradigms, is intended to be used
in a first course in computer science. It emphasizes the basic concepts of
programming and presents, in parallel, the two principal paradigms for
structuring programs: the procedure-oriented paradigm and the object-oriented
paradigm. This approach is intended to help students understand both
paradigms and to move more easily between them. No previous knowledge
of programming is needed, although some contact with computers and their
operating environments would be an asset.
The programming language used in this book is Object Oriented Turing (OOT),
which has an easy-to-learn syntax and is supported by student-friendly
programming environments. By learning the fundamentals of programming
using a language that does not intrude with a difficult syntax, students
can make a relatively easy transition to any one of the currently popular
object-oriented languages such as C++ or Java.
Overview
This book covers the material in standard curricula for first courses in
computer science. As well, it features an introduction to the object-oriented
paradigm.
The list of chapter titles outlines the arrangement of materials.
- Programming Paradigms
- Basic Programming Language Concepts
- Input of Data
- Control Constructs
- Procedures
- Functions
- Objects, Classes, and Inheritance
- Arrays
- Records, Unions, and Sets
- Algorithms for Sorting Lists
- Pointers and Linked Lists
- Trees
- Advanced Graphics and Sound
Chapter 1 introduces the two major programming paradigms:
procedure-oriented and object-oriented programming. The concepts
of procedural and data abstraction in programs are shown as ways
to make programs easier to create and to understand. Procedures,
modules, objects, and classes are introduced through the use of
simple graphics examples. The basic elements of OOT syntax are
also presented. The details of all these concepts are explored
in later chapters.
Chapter 2 presents the EBNF metalanguage for formally
describing the syntax of a programming language. The simple
data types of the OOT language are defined along with the way
to declare variables of these types. Expressions for each type
are also defined and the statement that assigns the value of such
an expression to a variable of the appropriate type introduced.
How values of the different data types are output and formatted
is explained. Comments are shown as providing internal documentation
to a program.
Chapter 3 discusses how data can be input to a program. Ways in
which a list of data items can be input by counted or conditional loops
are shown. Input from the standard input, the keyboard, and input from
a file are discussed. Input of string data by token, characters, or by
line is presented. Ways to generate data using random numbers, for
purposes of testing programs are presented. The statistical analysis
of numerical data is also described.
Chapter 4 deals with program structure. Programs are described
as consisting of the three basic forms of structure: linear sequence,
repetition, and selection. The OOT syntax for each of these is defined.
The use of diagrams such as flow charts to supplement the program itself
is discussed and shown to be unnecessary for a structured program properly
paragraphed and internally documented. Tracing execution of a program before
trying to run it on a computer is encouraged.
Chapter 5 provides details about procedures - subprograms that act.
The relationship between formal and actual parameters is defined. Variable
parameters are introduced. The scope of identifiers in a program is defined.
Ways of formally specifying the action of a procedure, testing it, and
tracing the execution are outlined.
Chapter 6 defines functions - subprograms that produce a value
from parameters that are provided to it. Many predefined functions are
reviewed. Declaration and specification of functions is formalized, and
the perils of side effects discussed. Functions that call themselves -
recursive functions - and iterative functions that accomplish the same
result are dealt with.
Chapter 7 shows how objects can encapsulate data and the procedures
or functions that operate on the data and illustrates how other objects or
programs using the object are prevented from interfering with the
encapsulated data. The use of predefined objects is discussed, as well
as ways of creating new objects. Students are introduced to a class as
a pattern or template for creating multiple objects. Inheritance is
introduced as the means by which new classes are created through
modifications of a base or parent class. By using a library of classes
students will be able both to create multiple objects (instances) and
to create new classes.
Chapter 8 introduces the structured data type called an array.
This chapter demonstrates how individual elements of an array share
the same name and data type but are distinguished from each other by
having an index. It also illustrates how arrays passed as parameters
to subprograms may have dynamic definition. The efficiencies of searching
an unsorted array by a linear search and a sorted array by a binary search
are compared.
Chapter 9 describes additional data types that are structured,
that is, composed of groups of simple data types or of structured types
themselves. The use of the types: record, union, and set, is discussed.
A simple linear search of an array of records is introduced as an example
of using records.
Chapter 10 presents algorithms for sorting lists of records stored
in arrays. The time complexity of sorting algorithms is explored and big
O notation introduced. The chapter also explains how methods depending
on recursion prove to be much more efficient than simple exchange algorithms.
Chapter 11 gives details of pointers and how they can be used to link
records together in simple linked lists and in the instantiation of a class
to produce an object. A list class is created and then modified to produce
an ordered list class by inheritance.
Chapter 12 introduces the binary tree as a data structure that has
a recursive definition and is easily implemented by pointers. The chapter
demonstrates how the binary search tree provides the efficiency of
searching achieved with a sorted array using a binary search, and the
ease of insertion and deletion of elements in a linear listed list.
The heap sort is introduced as a recursive method of sorting which
uses trees that are defined somewhat differently than binary search trees.
Chapter 13 describes the use of the OOT modules for creating
relatively complex graphics, including animation and accompanying
sound. A class is defined to allow the creation of multiple pie
charts. Other areas covered include OOT predefines for graphics
and font control.
Flexibility
Programming: Concepts and Paradigms has been organized to
provide a conceptually coherent introduction to computer science
arising from consideration of the procedure-oriented paradigm and
the object-oriented paradigm. Differing course demands and student
populations, however, may require instructors to omit certain chapters
or parts of chapters, or to insert additional material to cover some
concepts in greater detail. It should be noted that big O notation,
unions, and sets can be easily omitted from the course of study. The
instructor may also wish to provide other resources if more than an
introduction to program correctness is desired.
Object Oriented Turing
This book uses the language Object Oriented Turing (OOT). One of the
main advantages of using OOT for instruction is that its simple syntax
allows instructors to cover more computer science concepts in the limited
teaching hours available in a course. This is possible because significantly
less time needs to be devoted to teaching language details.
The Turing language was developed in 1982 in response to the need for
a programming notation that incorporates good structuring methods,
supports a correctness approach, is easy for the student to learn,
and is suited to interactive programming. This language has gained
considerable acceptance as a teaching medium.
The Turing language has undergone extensive enhancement, in terms of
both software support and language notation, since its inception. In
1992 a superset of Turing, called Object Oriented Turing (OOT) was
created by adding a number of features including classes, inheritance,
concurrency, and unit-based separate compilation.
The programming environment for OOT is particularly helpful for the
learning student. It provides good diagnostic messages for syntax
errors and run-time errors. It provides strong run-time checking,
with automatic detection of uninitialized variables and dangling
pointers. It supports an on-line manual (lookup of language features
by a button press), a directory browser, and multi-window editing.
Versions of the environment allow the student to use a wide variety
of hardware platforms and operating systems.
Once programming concepts have been learned in OOT, it is relatively
easy to transfer these ideas to new situations. In particular, data
structuring, algorithms, and object-orientation learned using OOT
transfer directly to industrial systems such as C++ and Java. Of
course, in order to use C++ or Java effectively, the student must
also learn to cope with a difficult syntax and with minimal run-time
checking, things which are best put off until essential concepts are
mastered.
J.N.P. Hume
D.T. Barnard
Table of Contents of Programming: Concepts and Paradigms (1st edition)
PREFACE
ACKNOWLEDGMENTS
Chapter 1 - PROGRAMMING PARADIGMS
1.1 What is Programming?
1.2 The Object Oriented Turing Language
1.3 Abstraction in Programs
Procedural Abstraction
Data Abstraction
1.4 Programming Paradigms
Procedure-Oriented Programming
Object-Oriented Programming
1.5 Choosing a Programming Paradigm
1.6 Using Predefined Graphics Procedures
Locating a Figure in the Execution Window
Drawing a Colored Box in the Window
Exercises
1.7 User-Defined Procedures
Simple Examples of User-Defined Procedures
A More Complicated Example
Exercises
1.8 Creating an Object
1.9 Creating Window Objects with Classes
1.10 Chapter Summary
Steps in Programming
Object Oriented Turing (OOT)
Procedural Abstraction
Data Abstraction
Object-Oriented Programming
Predefined Graphics Procedures
User-Defined Procedures
Structure Charts
Other OOT Syntax
Creating an Object
Using a Class
1.11 Exercises
Chapter 2 - BASIC PROGRAMMING LANGUAGE CONCEPTS
2.1 Metalanguage for Defining Syntax
2.2 Simple Data Types
2.3 Declarations of Variables
2.4 Expressions: Arithmetic, String, and Boolean
Arithmetic Expressions
String Expressions
Boolean Expressions
2.5 Assignment Statements
Initializing Variables in their Declarations
Constants
Syntax of Assignment Statements
Variable Names on both sides of an
Assignment Statement
Enumerated Type
2.6 Output Statements
Output Formatting
2.7 Comments
2.8 Chapter Summary
Metalanguage for Syntax Definition
Simple Data Types and Declarations
Arithmetic Expressions
String Expressions
Boolean Expressions
Assignment Statements
Enumerated Types
Output Statements
Comments
2.9 Exercises
3 INPUT OF DATA
3.1 Input of Programs
3.2 Input of Numerical Data
3.3 Input of String Data
3.4 Input of Sequences of Data
Counted Repetition
Conditional Repetition
3.5 Input from a File
3.6 Output to a File
3.7 Input of a Line of Characters
3.8 Generated Data
3.9 Statistical Analysis of Data
3.10 Chapter Summary
Token-Oriented Input
Input of Sequences of Data
Input from a File
Output to a File
Input of Data a Line at a Time
Generated Data
Statistical Analysis of Data
3.11 Exercises
Chapter 4 - CONTROL CONSTRUCTS
4.1 Structure of Programs
4.2 Repetition Constructs
The Counted Loop
The Conditional Loop
Testing of Loops
Proving Loop Correctness
Multiple Exits and Exits from Counted Loops
4.3 Basic Selection Constructs
Text Formatting
4.4 Procedures
4.5 Flow Charts
4.6 Tracing Execution
4.7 Another Selection Construct
4.8 Checking Input Data
4.9 Pattern Recognition in Strings
4.10 Chapter Summary
Structure of Programs
Flow Charts
Repetition Constructs
Selection Constructs
Procedure Construct
Flow Charts
Tracing Execution
Another Selection Construct
Checking Input Data
4.11 Exercises
Chapter 5 - PROCEDURES
5.1 Simple Procedures
5.2 Simple User-Defined Procedures
5.3 Procedures with Variable Parameters
5.4 An Example Using Procedures
5.5 Procedures Using Global Variables and Constants
5.6 Scope of Identifiers
5.7 Pre- and Postconditions
5.8 Testing of Programs
5.9 Tracing of Programs
5.10 Chapter Summary
Declaring Procedures
Local Identifiers, Global Identifiers, and Parameters
Variable Parameters
Pre- and Postconditions
Testing of Programs
Tracing of Programs
5.11 Exercises
Chapter 6 - FUNCTIONS
6.1 Predefined Functions
6.2 User-Defined Functions
Pre- and Postconditions
6.3 Recursive Functions
6.4 An Example Using Functions
6.5 Side Effects
6.6 Chapter Summary
Predefined Functions
User-Defined Functions
Recursive Functions
Side Effects
6.7 Exercises
Chapter 7 - OBJECTS, CLASSES, AND INHERITANCE
7.1 Modules, Objects, and Abstract Data Types
7.2 Using an Object
7.3 Creating an Object
7.4 Using a Class
7.5 Creating a Class
7.6 Creating a New Class by Inheritance
Using the Modified Class
7.7 Chapter Summary
Abstract Data Types
Using an Object
The Turtle Object
Creating an Object
Form of Object Definition
Classes
Creating a New Class by Inheritance
7.8 Exercises
Chapter 8 - ARRAYS
8.1 Lists as Arrays
Frequency Distribution
A Class for Maintaining a List of Names
Computing Prime Numbers
8.2 Related Lists
8.3 Declaration of Arrays
8.4 Two-Dimensional Arrays
8.5 Subprograms With Array Parameters
8.6 Searching
8.7 Efficiency of Algorithms
Running Time for Sequential Search
Running Time for Binary Search
Big O Notation
Concentrating on Loops and Recursion
8.8 Chapter Summary
Lists as Arrays
Related Lists
Declaration of Arrays
Tables as Arrays
Subprograms With Array Parameters
Searching
Efficiency of Algorithms
8.9 Exercises
Chapter 9 - RECORDS, UNIONS, AND SETS
9.1 Records
9.2 Arrays of Records
Input and Output of an Array of Records
9.3 Searching an Array of Records
Two-Dimensional Arrays of Records
9.4 Storing Records in Binary Files
9.5 Unions
9.6 Sets
An Array of Sets
9.7 Chapter Summary
Records
Moving Records in Memory
The Bind Construct
Files of Records
Random Access to Records in a File
Unions
Sets
9.8 Exercises
Chapter 10 - ALGORITHMS FOR SORTING LISTS
10.1 What is Sorting?
10.2 Insertion Sort
10.3 Selection Sort
10.4 Bubble Sort
Top Down Design of Bubble Sort
Improving Bubble Sort
10.5 Running Time for Sorting Algorithms
Running Time for Bubble Sort
Running Time of Insert and Selection Sort
10.6 Merge Sort
The Nature of Recursion
10.7 Quicksort
10.8 Chapter Summary
Insertion Sort
Selection Sort
Bubble Sort
Recursive Sorts
Merge Sort
Quicksort
Timing of Recursive Sorts
10.9 Exercises
Chapter 11 - POINTERS AND LINKED LISTS
11.1 Declaring and Using Pointers
11.2 Pointers as Links
11.3 Singly Linked Lists
11.4 A List Class
Sample Execution of Demonstration Program
11.5 Pointer Implementation of List Class
11.6 Ordered Lists
11.7 Problems with Pointers
11.8 Chapter Summary
Declaring and Using Pointers
Pointers as Links
List Class
Pointer Implementation of List Class
Ordered Lists
11.9 Exercises
Chapter 12 - TREES
12.1 Binary Search Trees
12.2 An Implementation of the Ordered List Using a Tree
12.3 Using a Binary Tree to Sort: Heap Sort
12.4 Chapter Summary
Binary Search Trees
Sorting Using a Binary Search Tree
Heaps
Implementing a Heap Using an Array
Sorting Using a Heap
Chapter 13 - ADVANCED GRAPHICS AND SOUND
13.1 Using a Class to Draw Multiple Pie Charts
13.2 Using the Pie Class to Produce a LabelledPie Class
13.3 Animation with Sound
13.4 Interactive Graphics
13.5 Graphical User Interfaces
13.6 Chapter Summary
A Pie Class Used to Create Multiple Pie Charts
Using the Pie Class to Produce a LabelledPie Class
Animation with Sound
Interactive Graphics
Graphical User Interfaces (GUI)
13.7 Exercises
APPENDICES
Appendix A : Reserved Words
Appendix B : Predefined Subprograms by Module
Appendix C : Classes and Modules Supplied with OOT
Appendix D : Operators
Appendix E : Keyboard Codes for IBM PC
Appendix F : Character Set for IBM PC
Appendix G : File Statements
Appendix H : Simplified Syntax of OOT
Appendix I : Installing OOT for Windows
Macintosh
System Requirements
Windows 3.1
Windows 95
Appendix J : Using OOT for Windows
Contents of this Appendix
Starting WinOOT
WinOOT Environment
Control Panel
Directory Viewer
Editor window
Error Viewer
Run Window
Debugger Window
Keyboard Editing Commands
Selection, Cutting and Pasting
Searching and Replacing Text
Running Programs - Input and Output Redirection
Running Programs - Programs with Multiple Parts
Menus Commands - Control Panel
Menus Commands - Directory Viewer
Menus Commands - Editor Window
Stepping and Tracing
Showing Variables
Tutorial
INDEX
[ Holt Software Home ] *
[ Books (Graphical) ] *
[ Books (Text) ] *
[ Top of Page ] *
[ Feedback ]