| Preface | p. v |
| Acknowledgments | p. vi |
| About the Author | p. vii |
| Hello Pascal | p. 1 |
| Your First Pascal Program | p. 1 |
| Comments | p. 1 |
| Program Heading | p. 2 |
| Syntax and Conventions | p. 2 |
| Displaying Text: Writeln, Write | p. 3 |
| Crunching Numbers | p. 4 |
| Integers and Real Numbers | p. 5 |
| Evaluation of Arithmetic Expressions | p. 7 |
| Using Variables | p. 9 |
| Variable Declaration | p. 9 |
| The Assignment Statement | p. 10 |
| Named Constants | p. 12 |
| Type Conversion: Round, Trunc | p. 13 |
| Reading from the Keyboard: Readln, Read | p. 14 |
| Formatting Output | p. 15 |
| Summary | p. 17 |
| Exercises | p. 18 |
| Answers | p. 18 |
| Language Elements | p. 19 |
| Standard Data Types and Functions | p. 19 |
| Numeric Data Types | p. 19 |
| Numeric Types in Turbo Pascal | p. 20 |
| Standard Arithmetic Functions | p. 21 |
| Example: The Power Function | p. 23 |
| Example: Grocery Store | p. 23 |
| Turbo Pascal Additional Functions | p. 25 |
| The Character Type: CHAR | p. 26 |
| Standard Functions for Characters | p. 27 |
| Strings in Standard Pascal | p. 29 |
| The String Type | p. 30 |
| Declaration of a String | p. 30 |
| The Length of a String | p. 31 |
| The Boolean Type | p. 32 |
| Simple Boolean Expressions | p. 32 |
| Compound Boolean Expressions | p. 34 |
| Turbo Pascal Operators | p. 35 |
| Precedence of Operators | p. 35 |
| Summary | p. 36 |
| Exercises | p. 38 |
| Answers | p. 38 |
| Decisions | p. 39 |
| Making Decisions | p. 39 |
| The Simple Decision: If-then | p. 40 |
| Example: Pascal Credit Card | p. 40 |
| Using Blocks | p. 42 |
| The If-then-else Construct | p. 43 |
| The Else-if Ladders | p. 45 |
| Example: A Character Tester | p. 46 |
| Nested Conditions | p. 47 |
| Example: Scores and Grades | p. 47 |
| Tips on the If-Else Puzzles | p. 50 |
| The Multiple Choice: Case | p. 51 |
| Example: A Vending Machine | p. 51 |
| Example: Number of Days in a Month | p. 52 |
| Unconditional Branching: GOTO | p. 54 |
| Repetition Loops | p. 55 |
| Turbo Pascal Features: Exit, Case-Else | p. 56 |
| Summary | p. 57 |
| Exercises | p. 59 |
| Answers | p. 60 |
| Loops | p. 61 |
| Looping | p. 61 |
| The For Loop | p. 62 |
| Example: Powers of Two | p. 64 |
| Example: The Average | p. 65 |
| Stepping Up and Stepping Down | p. 66 |
| Example: The Factorial | p. 67 |
| Nested Loops | p. 68 |
| The While Loop | p. 69 |
| The Repeat Loop | p. 72 |
| Summary | p. 74 |
| Exercises | p. 75 |
| Answers | p. 76 |
| Data Architecture | p. 77 |
| Ordinal Data Types | p. 77 |
| Enumerations | p. 77 |
| Subranges | p. 79 |
| The TYPE Section | p. 81 |
| Renaming Types | p. 81 |
| Naming User-Defined Types | p. 82 |
| Arrays as Data Structures | p. 83 |
| One-Dimensional Arrays | p. 85 |
| Example: Scores of One Student | p. 85 |
| Displaying Tabulated Results | p. 87 |
| Declaration of Arrays in the TYPE Section | p. 90 |
| Example: Sorting an Array | p. 90 |
| Two-Dimensional Arrays | p. 93 |
| Example: Scores of Students | p. 94 |
| Array Initialization | p. 96 |
| Summary | p. 97 |
| Exercises | p. 98 |
| Answers | p. 99 |
| Text Processing | p. 101 |
| Manipulating Text Data | p. 101 |
| Tips on OUTPUT Statements | p. 101 |
| Tips on INPUT Statements | p. 102 |
| Using READLN for Numeric Input | p. 102 |
| Using READ for Numeric Input | p. 104 |
| Using READ for Character Input | p. 105 |
| Using READLN for Character Input | p. 107 |
| Input of Mixed Types | p. 108 |
| Example: Scrambling Letters | p. 109 |
| Reading a Line of Text: EOLN | p. 111 |
| Example: Character Counter | p. 111 |
| Reading a File of Text: EOF | p. 112 |
| Example: Frequency Counter | p. 112 |
| String Manipulation | p. 113 |
| Tips on String Input/Output | p. 113 |
| Example: Sorting Names | p. 114 |
| String Functions and Procedures | p. 116 |
| LENGTH | p. 116 |
| CONCAT | p. 117 |
| COPY | p. 117 |
| POS | p. 117 |
| DELETE | p. 117 |
| INSERT | p. 118 |
| Summary | p. 119 |
| Exercises | p. 119 |
| Answers | p. 120 |
| Program Architecture | p. 121 |
| Programs and Subprograms | p. 121 |
| Procedures | p. 121 |
| Procedure Definition | p. 122 |
| Passing Values to Procedures | p. 123 |
| Passing Back Values from Procedures | p. 126 |
| Global and Local Variables | p. 127 |
| Example: Sorting Procedure | p. 127 |
| Functions | p. 130 |
| Tips on the Scope of Variables | p. 131 |
| Recursion | p. 133 |
| Summary | p. 134 |
| Exercises | p. 134 |
| Answers | p. 135 |
| Sets and Records | p. 137 |
| Sets | p. 137 |
| Set Declaration and Assignment | p. 138 |
| Rules and Restrictions | p. 139 |
| Set Operators and Operations | p. 140 |
| Union | p. 140 |
| Intersection | p. 140 |
| Difference | p. 140 |
| Tips on Using Set Operators | p. 140 |
| Relational Operators | p. 141 |
| Example: Text Analyzer | p. 142 |
| Records | p. 144 |
| Record Declaration | p. 144 |
| Accessing Fields | p. 145 |
| The WITH Statement | p. 146 |
| Nesting Records | p. 149 |
| Summary | p. 151 |
| Exercises | p. 152 |
| Answers | p. 153 |
| Files and Applications | p. 155 |
| Data Files | p. 155 |
| TEXT Files | p. 156 |
| Reading a TEXT File | p. 156 |
| File Variables | p. 156 |
| File Parameters | p. 157 |
| Opening a File for Input: RESET | p. 157 |
| Closing the File | p. 158 |
| File Input Procedures: READ, READLN | p. 158 |
| The EOF and EOLN Functions | p. 159 |
| Example: Disk-File Text Analyzer | p. 159 |
| Displaying a TEXT File | p. 162 |
| Reading a TEXT File as a Set of Strings | p. 163 |
| Reading Multiple Strings | p. 164 |
| Creating a TEXT File: REWRITE | p. 165 |
| File Output Procedures: WRITE, WRITELN | p. 165 |
| Example: Employee File | p. 166 |
| Example: Payroll | p. 168 |
| Non-TEXT Files | p. 172 |
| Example: Payroll System | p. 173 |
| Appending a File | p. 176 |
| Using the File Buffer Variable | p. 178 |
| Summary | p. 179 |
| Exercises | p. 180 |
| Answers | p. 181 |
| Using Variant Records | p. 183 |
| Variant Records | p. 183 |
| Example: Enhanced Payroll System | p. 185 |
| Deleting Records from the File | p. 192 |
| Updating Records | p. 201 |
| Enhance the Program Modularity | p. 204 |
| Suggestions | p. 214 |
| Summary | p. 214 |
| Exercises | p. 215 |
| Answers | p. 215 |
| Pointers and Linked Lists | p. 217 |
| Dynamic Memory Allocation | p. 217 |
| Pointers | p. 217 |
| Pointer Operations | p. 220 |
| Pointers to Records | p. 222 |
| Passing Pointers as Parameters | p. 224 |
| Basics of Linked Lists | p. 225 |
| List Declaration | p. 225 |
| Building a List | p. 225 |
| Reading a List | p. 227 |
| Example: A Linked List Demo | p. 229 |
| Storing Lists in Files | p. 232 |
| Reading Lists from Files | p. 233 |
| Example: A List of Records | p. 234 |
| Searching Lists | p. 235 |
| Deleting Nodes from Lists | p. 243 |
| Summary | p. 253 |
| Exercises | p. 254 |
| Answers | p. 255 |
| The Next Step | p. 256 |
| The ASCII Character Set | p. 257 |
| Reserved Words and Standard Identifiers | p. 261 |
| Answers to Drills | p. 265 |
| Index | p. 317 |
| Table of Contents provided by Syndetics. All Rights Reserved. |