Home page of Holt Software Associates  | Home page of the Turing Programming Language, the fastest way to teach programming concepts  | Home page of Holt Software's Java products  | Home page of Ready to Program with Java(tm) Technology, a Java development environment designed for education  | Information about Holt Software's courses for teachers  | Information about how to contact Holt Software  | Information about how students can purchase Holt Software's books and software  | Information about how schools and bookstores can purchase Holt Software's books and software

Holt Software Books    [Graphical Version]  |  [Printer Friendly Version]

[Cover of Book]

Introduction to Programming in Turing


Book Information

Title: Introduction to Programming in Turing (First Edition)
Author: J.N.P. Hume
ISBN: 0-921598-42-4
Publisher: Holt Software Associates Inc.
Binding: Softcover
Pages: 480 pgs
Price: Bookstores & Schools: $32.00    Retail: $40.00
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.]

Book Description

An Introduction to Programming in Turing has been designed to meet the curriculum expectations of the grade 10 and 11 computer science courses.

An Introduction to Programming in Turing focuses on computing concepts with the ultimate goal of facilitating the broadest possible coverage of the core computer science curriculum. It emphasizes programming within the larger context of computer science and computer science within the context of problem solving and design. This text begins with the basic programming concepts such as repetition and selection and progresses to advanced topics such as arrays, subprograms, records, and binary files. It also includes student motivators such as graphics, music, and GUIs.

Each chapter provides support for students with example programs and numerous exercises. All example programs used in the textbook are also available with the software and on-line.

It is envisioned that a grade 9 course would cover the first nine chapters of the Introduction to Programming in Turing, a grade 10 course, the first fourteen chapters and a grade 11 or college course would cover the entire book.

Note that while this book uses the Object Oriented Turing software, it does not cover Object Oriented Programming at all. Those interested in teaching Object Oriented Programming should look at Programming: Concepts and Paradigms which covers the topic in depth.


Correlations with Ontario Computer Studies Curriculum

Holt Software has examined Introduction to Programming in Turing and correlated it with the new Ontario Computer Studies Curriculum. The correlations of the book with the Grade 10 TIK20 and Grade 11 ICS3M course is available in PDF (Adobe Acrobat) format. The document lists the expectations for the course and the location in the book where the expectation is addressed.

If you have Adobe Acrobat Reader installed, then click on the link below. If you do not have Acrobat Reader, then you can obtain it free of charge by clicking the Get Acrobat Reader icon.

Get Acrobat Reader

Preface to Introduction to Programming in Turing (First Edition)

This textbook, Introduction to Programming in Turing, is intended to be used in a first computer science course. It emphasizes the basic concepts of programming and sets programming within the larger context of computer science and computer science within the context of problem solving and design.

Introduction to Programming in Turing focuses on computing concepts with the ultimate goal of facilitating the broadest possible coverage of the core computer science curriculum.

The programming language used in this book is 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.

The list of chapter titles outlines the arrangement of materials.

  1. Computing Essentials
  2. The Turing Environment
  3. Program Design and Style
  4. Simple Programs
  5. Variables and Constants
  6. Repetition
  7. Character Graphics
  8. Pixel Graphics
  9. Selection
  10. Storing Data on the Disk
  11. Handling Strings
  12. Processing Text
  13. Program Structure
  14. Arrays and Other Data Types
  15. Music
  16. Subprograms
  17. Subprograms with Array Parameters
  18. Records and Files
  19. Advanced Topics
  20. Advanced Pixel Graphics
  21. Animation and GUIs

Chapter 1 provides an overview of the history of modern computing, including hardware, software, programming languages, and number systems. By highlighting a number of key technological developments, it attempts to place Computer Engineering today in its scientific and social context. It also explores some of the current issues in computing such as employment, privacy, and access to information.
Chapter 2 describes how to use the Turing environment. The chapter also covers how syntax errors are reported and how they are corrected.
Chapter 3 introduces some of the key ideas in computer science. It explains the process of programming and provides suggestions for good programming style. It also introduces important design concepts such as the software lifecycle.
Chapter 4 introduces programs that consist of a single line. Arithmetic operations for both integers and real numbers are illustrated. Labels are shown to improve the understandability of results that are output. Programs of several lines are used to output a series of lines.
Chapter 5 shows how declarations are used to prepare locations in memory for storing information. Strings and numbers are input to set values of variables. The use of constants and comments to improve the program understandability is illustrated. Prompts are also introduced as a way of informing users what is expected of them.
Chapter 6 introduces the repetition control structure used in structured programming. Both counted and conditional loops are discussed. The exit condition is explained in terms of providing a means for exiting from any point within the loop. Random integers are generated to control loop termination.
Chapter 7 shows how characters can be positioned in the Execution window to create various patterns. Manipulation of character colors and background colors is also demonstrated. The use of drawing and erasing a pattern to achieve the illusion of animation is also introduced.
Chapter 8 explains how to create graphics by plotting in pixel positions in the Execution window. The instructions for plotting points, lines, ovals, and arcs to allow the creation of simple line graphics is illustrated. Graphics with colored backgrounds, closed curves filled with color and sound are also explored.
Chapter 9 introduces the selection construct. Two-way, three-way, and multi-way selection are investigated. The case construct is presented as an alternative to the if..then..elsif..else structure for programming multi-way selection.
Chapter 10 shows how to redirect a program's output to a disk file rather than or in addition to displaying it in the Execution window. Using the disk file to provide input to a program is also explained and using the end-of-file automatically placed at the end of any disk file is introduced. Reading of lines of text from the disk is shown as an alternative to token-oriented input of string data.
Chapter 11 outlines methods to: find the length of a strong, join strings together, locate a substring, search for a pattern in a string, replace one pattern with another, and eliminate characters or patterns from strings. A method of preventing improper input to a program from causing a program crash is shown.
Chapter 12 summarizes various ways of inputting text material from a file by token, line, or number of characters. Ways of handling multiple files directly in a program rather than by redirection are shown. Text formatting is described and a simple example of language translation is programmed.
Chapter 13 presents flow charts for the three basic control structures used in structured programming: linear program flow, repetition, and selection. Charts for nesting of structures and multi-way selection are also shown. The scope of declarations of variables and constants is discussed. Top-down program design is outlined.
Chapter 14 defines the declaration of the array type. The use of arrays is discussed with examples for sorting lists. The datatypes: subrange, boolean, and named are given with examples of their use. Two-dimensional arrays are illustrated by tables.
Chapter 15 describes how to play musical notes, both individually and as a series. Arranging the music to accompany graphic animation in the Execution window is illustrated.
Chapter 16 introduces the two types of Turing subprograms: functions that produce a value and procedures that produce some action. Both predefined and user-created examples of these two types of subprograms are presented. The notion of parameters, both value and variable, are explained. Type transfer functions and recursive subprograms are introduced.
Chapter 17 shows how both functions and procedures can have parameters that are of array type. The correspondence between formal and actual parameters is presented and the idea of dynamic formal parameters for arrays introduced. Local and global variables are differentiated.
Chapter 18 describes the declaration, input, and output for the data type record. Arrays and files of records are presented and the movement of records in memory is explained. Text and binary files are contrasted and the way that random access to records on disk is obtained is described. An example of maintaining a binary file of records is presented.
Chapter 19 introduces binary search as an efficient method of searching in a sorted file. The method of sorting by merging is detailed . Files stored as linked lists of records are described and an example of a highly interactive graphic is presented.
Chapter 20 examines programs for pixel graphic examples that require the use of more complex mathematics or subprograms with array parameters. Animation using a buffer is shown. Methods of displaying statistical information in a graphical format such as a pie or bar chart are given. Mathematical functions are plotted.
Chapter 21 shows programs involving animation requiring interaction with the mouse. Two advanced animation techniques are described. These include use of the Pic and Sprite modules available in the OOT library of predefined modules. Another module which facilitates the creation of graphical user interface (GUI) elements such as input boxes and buttons, as well as sound with animation, is introduced.

Flexibility

Introduction to Programming in Turing has been organized to provide an introduction to the fundamental concepts of computer science.

Differing course demands and student populations may require instructors to omit certain chapters or parts of chapters, or to insert additional material to cover some concepts in greater detail. For example, instructors wishing to address the historical information in Chapter 1 after students have more hands-on programming may choose to begin with a later chapter.

The Turing Programming Language

This book uses the language Turing. One of the main advantages of using Turing 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 first 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 objects, classes, and inheritance.

The programming environment for Turing 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, in the advanced mode, 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 Turing, 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.

J.N.P. Hume
University of Toronto


Table of Contents of Introduction to Programming (First Edition)

  • Chapter 1: Computing Essentials
  • 1.1 Introduction
  • 1.2 A Brief History of Computer Hardware
  • 1.3 A Brief History of Programming
  • 1.3.1 A New Way of Organizing Large Programs
  • 1.4 What is a Computer?
  • 1.4.1 The Central Processing Unit
  • 1.4.2 Memory
  • 1.4.3 Output Devices
  • 1.5 Number Systems: Decimal and Binary
  • 1.6 Hardware and Networks
  • 1.6.1 Different Kinds of Computers for Different Needs
  • 1.6.2 The Silicon Chip
  • 1.7 Software
  • 1.7.1 Operating Systems
  • 1.7.2 Programming Environments
  • 1.7.3 Applications
  • 1.8 The Social Impact of Computers
  • 1.8.1 Employment
  • 1.8.2 Privacy
  • 1.8.3 Access to Information
  • 1.8.4 Leisure Activities
  • 1.8.5 Illegal Activity
  • 1.8.6 Computers: Good or Bad?
  • 1.9 Exercises
  • 1.10 Technical Terms
  • Chapter 2: The Turing Environment
  • 2.1 Introduction
  • 2.2 The Editor Window
  • 2.2.1 Cut, Copy, and Paste
  • 2.2.2 Undo
  • 2.3 Saving Programs on Disk
  • 2.4 Running Programs
  • 2.4.1 Input/Output Redirection
  • 2.5 Indenting Programs and Syntax Coloring
  • 2.5.1 Indenting Programs
  • 2.5.2 Syntax Coloring
  • 2.6 Starting and Stopping the Environment
  • 2.7 Opening an Existing Program
  • 2.8 Searching for Text in a File
  • 2.8.1 Finding Text in a File
  • 2.8.2 Replacing Text in the File
  • 2.9 Printing a Program
  • 2.10 Example Turing Programs
  • 2.11 Exercises
  • 2.13 Technical Terms
  • Chapter 3: Program Design and Style
  • 3.1 Programming and Programmers
  • 3.2 Programming Style
  • 3.3 The Software Development Process
  • 3.4 Procedure-Oriented Programming
  • 3.5 Exercises
  • 3.6 Technical Terms
  • Chapter 4: Simple Programs
  • 4.1 A One-Line Program
  • 4.2 Changing the Program
  • 4.3 Substituting One String of Characters for Another
  • 4.4 A Program that Computes
  • 4.5 Integers and Real Numbers
  • 4.6 Arithmetic Expressions
  • 4.7 Combining Calculations and Messages
  • 4.8 Output of a Series of Items
  • 4.9 A Series of Output Statements
  • 4.10 Exercises
  • 4.11 Technical Terms
  • Chapter 5: Variables and Constants
  • 5.1 Storing Information in the Computer
  • 5.2 Declaring Variables
  • 5.2.1 Names of Variables
  • 5.3 Inputting Character Strings
  • 5.3.1 Strings Containing Blanks
  • 5.4 Mistakes in Programs
  • 5.5 Inputting Numbers
  • 5.5.1 Mistakes in Data
  • 5.6 Inputting Real Numbers
  • 5.7 Constants
  • 5.8 Assignment of Values to Variables
  • 5.9 Understandable Programs
  • 5.10 Comments in Programs
  • 5.11 Exercises
  • 5.12 Technical Terms
  • Chapter 6: Repetition
  • 6.1 Loops
  • 6.2 Conditional Loops
  • 6.2.1 Comparisons
  • 6.2.2 Comparing Strings
  • 6.2.3 An Example Conditional Loop
  • 6.2.4 Another Conditional Loop
  • 6.3 Counted Loops
  • 6.3.1 Counting in Multiples
  • 6.3.2 Indenting the Body of Loops
  • 6.3.3 Loops that Count Backwards
  • 6.3.4 Counted Loop Examples
  • 6.3.5 Counted Loops with Exits
  • 6.4 Random Exit from Loop
  • 6.5 Compound Conditions
  • 6.6 Exercises
  • 6.7 Technical Terms
  • Chapter 7: Character Graphics
  • 7.1 Character Locations in the Execution Window
  • 7.2 Creating a Graphical Pattern with Characters
  • 7.2 1 Interactive Graphics
  • 7.2.2 Diagonal Lines and Patterns
  • 7.3 Drawing in Color
  • 7.4 Background Color
  • 7.5 Hiding the Cursor
  • 7.6 Animation with Graphics
  • 7.7 Controlling the Speed of Animation
  • 7.8 Pausing for User Input
  • 7.9 Exercises
  • 7.10 Technical Terms
  • Chapter 8: Pixel Graphics
  • 8.1 Pixel Positions in the Execution Window
  • 8.2 Plotting Dots in the Execution Window
  • 8.3 Changing the Execution Window Size
  • 8.4 Drawing Lines
  • 8.5 Drawing Circles and Ellipses
  • 8.6 Animation
  • 8.7 Drawing Arcs
  • 8.8 Plotting a Mathematical Function
  • 8.9 Using Text with Pixel Graphics
  • 8.10 Background Color
  • 8.11 Sound with Graphics
  • 8.12 Current Values of Graphic Parameters
  • 8.13 Exercises
  • 8.14 Technical Terms
  • Chapter 9: Selection
  • 9.1 Simple Selection
  • 9.2 Three-way Selection
  • 9.3 Multi-way Selection
  • 9.4 Case Construct
  • 9.5 Commands for Action
  • 9.6 Selecting from a Menu of Commands
  • 9.7 Exercises
  • 9.8 Technical Terms
  • Chapter 10: Storing Data on the Disk
  • 10.1 Data Files on Disk
  • 10.2 Input Data from Disk Files
  • 10.3 End-of-file for Data
  • 10.3.1 End-of-file with Strings
  • 10.4 Reading Lines of Text from a File
  • 10.5 Exercises
  • 10.6 Technical Terms
  • Chapter 11: Handling Strings
  • 11.1 Length of a String
  • 11.2 Joining Strings Together
  • 11.3 Selecting Part of a String
  • 11.4 Searching for a Pattern in a String
  • 11.4.1 Counting Patterns in a Word
  • 11.5 Substituting One Pattern for Another
  • 11.6 Eliminating Characters from Strings
  • 11.7 Bullet-Proofing Programs
  • 11.8 Exercises
  • 11.9 Technical Terms
  • Chapter 12: Processing Text
  • 12.1 Token-oriented Input
  • 12.2 Inputting a Fixed Number of Characters
  • 12.3 Line-oriented Input
  • 12.4 Files on Disk
  • 12.5 Reading one File and Writing Another
  • 12.6 Text Formatting
  • 12.7 Simple Language Translation
  • 12.8 Exercises
  • 12.9 Technical Terms
  • Chapter 13: Program Structure
  • 13.1 Structure Diagrams
  • 13.2 Nested Structures
  • 13.2.1 A Loop Nested Inside a Loop
  • 13.2.3 More Complicated Nesting of Structures
  • 13.3 Structure Diagram for elsif
  • 13.4 Declaration of Variables and Constants Inside Constructs
  • 13.5 Design of Programs
  • 13.5.1 Controlling Complexity
  • 13.6 Exercises
  • 13.7 Technical Terms
  • Chapter 14: Arrays and Other Data Types
  • 14.1 Array Data Types
  • 14.2 Manipulating Lists
  • 14.3 When to Use an Array
  • 14.4 Initialization of Arrays
  • 14.5 Sorting an Array
  • 14.6 Related Lists
  • 14.7 Subrange Data Types
  • 14.8 Boolean Data Types
  • 14.9 Tables
  • 14.10 Named Data Types
  • 14.11 Exercises
  • 14.12 Technical Terms
  • Chapter 15: Music
  • 15.1 Playing Musical Notes
  • 15.1.2 Resting for a While
  • 15.2 Playing a Series of Notes
  • 15.3 Using the Keyboard to Make Music
  • 15.4 Animation with Music
  • 15.5 Exercises
  • 15.6 Technical Terms
  • Chapter 16: Subprograms
  • 16.1 Functions
  • 16.1.1 Predefined Functions
  • 16.1.2 Type Transfer Functions
  • 16.1.3 User-created Functions
  • 16.1.4 A String-valued Function
  • 16.2 A Procedure with No Parameters
  • 16.3 A Procedure with One Parameter
  • 16.4 Variable Parameters in Procedures
  • 16.4.1 Procedures to Bullet-proof Input
  • 16.5 Predefined Procedures and Functions
  • 16.6 Recursive Subprograms
  • 16.7 Functions versus Procedures
  • 16.8 Exercises
  • 16.9 Technical Terms
  • Chapter 17: Subprograms with Array Parameters
  • 17.1 Functions with Array Parameters
  • 17.2 Array Parameters in Procedures
  • 17.3 Dynamic Formal Parameters
  • 17.3.1 Another Example of a Procedure
  • 17.3.2 An Example Using a Function and Procedures
  • 17.4 Local and Global Variables and Constants
  • 17.5 Maintaining a Sorted List
  • 17.6 Exercises
  • 17.7 Technical Terms
  • Chapter 18: Records and Files
  • 18.1 Declaration of Records
  • 18.2 Inputting and Outputting Records
  • 18.3 Arrays of Records
  • 18.4 Binding to Records
  • 18.5 An Example using a File of Records
  • 18.6 Moving Records in Memory
  • 18.7 Text Files
  • 18.8 Binary Files
  • 18.9 Random Access to Records on Disk
  • 18.9.1 An Example of Random Access to a Binary File
  • 18.10 Modification of Records on Disk
  • 18.11 Deletion of Records on Disk
  • 18.12 Exercises
  • 18.13 Technical Terms
  • Chapter 19: Advanced Topics
  • 19.1 Binary Search
  • 19.2 Sorting by Merging
  • 19.3 Files of Records in Linked Lists
  • 19.4 Highly Interactive Graphics
  • 19.5 Exercise
  • 19.6 Technical Terms
  • Chapter 20: Advanced Pixel Graphics
  • 20.1 Advanced Graphics Concepts
  • 20.2 Drawing a Tilted Box
  • 20.3 Repeating a Pattern
  • 20.4 Animation Using a Buffer
  • 20.5 Bar Charts
  • 20.6 Pie Charts
  • 20.7 Graphing Mathematical Equations
  • 20.8 Exercises
  • 20.9 Technical Terms
  • Chapter 21: Animation and GUIs
  • 21.1 The Mouse in Turing
  • 21.2 Animation using the Pic Module
  • 21.3 Animation using the Sprite Module
  • 21.4 The GUI Module
  • 21.5 Playing Music from Sound Files
  • 21.6 Exercises
  • 21.7 Technical Terms
  • Appendices
  • Appendix A: Simplified Turing Syntax
  • Appendix B: Predefined Subprograms
  • Appendix C: Predefined Subprograms by Module
  • Appendix D: Reserved Words
  • Appendix E: Operators
  • Appendix F: File Statements
  • Appendix G: Control Constructs
  • Appendix H: Colors in Turing
  • Appendix I: Keyboard Codes for IBM PC
  • Appendix J: ASCII Character Set
  • Appendix K: Glossary

  • INDEX

  • [ Holt Software Home ] * [ Books (Graphical) ] * [ Books (Text) ] * [ Top of Page ] * [ Feedback ]