Cover image for Learn Pascal in three days
Title:
Learn Pascal in three days
Author:
Abolrous, Sam A.
Personal Author:
Edition:
Third edition.
Publication Information:
Plano, TX : Wordware Pub., [2001]

©2001
Physical Description:
324 pages ; 24 cm
Language:
English
ISBN:
9781556228056
Format :
Book

Available:*

Library
Call Number
Material Type
Home Location
Status
Central Library QA76.73.P2 A25 2001 Book and Software Set Central Closed Stacks
Searching...

On Order

Summary

Summary

Learn Pascal in Three Days, Third Edition provides the novice programmer with the fundamentals of the language and is ideal for those wanting a solid foundation in structured programming. This update of one of the best-selling introductions to Pascal is designed for beginning programmers with its chapter summaries, review questions, hands-on examples, and easy-to-follow drills. Readers start with simple programs and end up with useful real-world applications. Among the topics covered are building and evaluating arithmetic expressions, using structures and loops, creating arrays, manipulating text data, writing procedures and functions to make programs more modular, and declaring and using pointers.

With this book, learn about the design of structured Pascal programs; problem-solving algorithms; simple and structured data types; variables, operators, and expressions; iteration, branching, and selection statements; pointers and linked lists; manipulating data files; real-life applications and solved drills.


Table of Contents

Prefacep. v
Acknowledgmentsp. vi
About the Authorp. vii
Chapter 1 Hello Pascalp. 1
1-1 Your First Pascal Programp. 1
Commentsp. 1
Program Headingp. 2
Syntax and Conventionsp. 2
1-2 Displaying Text: Writeln, Writep. 3
1-3 Crunching Numbersp. 4
Integers and Real Numbersp. 5
Evaluation of Arithmetic Expressionsp. 7
1-4 Using Variablesp. 9
Variable Declarationp. 9
The Assignment Statementp. 10
1-5 Named Constantsp. 12
1-6 Type Conversion: Round, Truncp. 13
1-7 Reading from the Keyboard: Readln, Readp. 14
1-8 Formatting Outputp. 15
Summaryp. 17
Exercisesp. 18
Answersp. 18
Chapter 2 Language Elementsp. 19
2-1 Standard Data Types and Functionsp. 19
2-2 Numeric Data Typesp. 19
Numeric Types in Turbo Pascalp. 20
2-3 Standard Arithmetic Functionsp. 21
Example: The Power Functionp. 23
Example: Grocery Storep. 23
Turbo Pascal Additional Functionsp. 25
2-4 The Character Type: CHARp. 26
Standard Functions for Charactersp. 27
Strings in Standard Pascalp. 29
2-5 The String Typep. 30
Declaration of a Stringp. 30
The Length of a Stringp. 31
2-6 The Boolean Typep. 32
Simple Boolean Expressionsp. 32
Compound Boolean Expressionsp. 34
Turbo Pascal Operatorsp. 35
Precedence of Operatorsp. 35
Summaryp. 36
Exercisesp. 38
Answersp. 38
Chapter 3 Decisionsp. 39
3-1 Making Decisionsp. 39
3-2 The Simple Decision: If-thenp. 40
Example: Pascal Credit Cardp. 40
Using Blocksp. 42
3-3 The If-then-else Constructp. 43
3-4 The Else-if Laddersp. 45
Example: A Character Testerp. 46
3-5 Nested Conditionsp. 47
Example: Scores and Gradesp. 47
Tips on the If-Else Puzzlesp. 50
3-6 The Multiple Choice: Casep. 51
Example: A Vending Machinep. 51
Example: Number of Days in a Monthp. 52
3-7 Unconditional Branching: GOTOp. 54
Repetition Loopsp. 55
3-8 Turbo Pascal Features: Exit, Case-Elsep. 56
Summaryp. 57
Exercisesp. 59
Answersp. 60
Chapter 4 Loopsp. 61
4-1 Loopingp. 61
4-2 The For Loopp. 62
Example: Powers of Twop. 64
Example: The Averagep. 65
4-3 Stepping Up and Stepping Downp. 66
Example: The Factorialp. 67
4-4 Nested Loopsp. 68
4-5 The While Loopp. 69
4-6 The Repeat Loopp. 72
Summaryp. 74
Exercisesp. 75
Answersp. 76
Chapter 5 Data Architecturep. 77
5-1 Ordinal Data Typesp. 77
Enumerationsp. 77
Subrangesp. 79
5-2 The TYPE Sectionp. 81
Renaming Typesp. 81
Naming User-Defined Typesp. 82
5-3 Arrays as Data Structuresp. 83
5-4 One-Dimensional Arraysp. 85
Example: Scores of One Studentp. 85
Displaying Tabulated Resultsp. 87
Declaration of Arrays in the TYPE Sectionp. 90
Example: Sorting an Arrayp. 90
5-5 Two-Dimensional Arraysp. 93
Example: Scores of Studentsp. 94
Array Initializationp. 96
Summaryp. 97
Exercisesp. 98
Answersp. 99
Chapter 6 Text Processingp. 101
6-1 Manipulating Text Datap. 101
6-2 Tips on OUTPUT Statementsp. 101
6-3 Tips on INPUT Statementsp. 102
Using READLN for Numeric Inputp. 102
Using READ for Numeric Inputp. 104
Using READ for Character Inputp. 105
Using READLN for Character Inputp. 107
Input of Mixed Typesp. 108
Example: Scrambling Lettersp. 109
6-4 Reading a Line of Text: EOLNp. 111
Example: Character Counterp. 111
6-5 Reading a File of Text: EOFp. 112
Example: Frequency Counterp. 112
6-6 String Manipulationp. 113
Tips on String Input/Outputp. 113
Example: Sorting Namesp. 114
6-7 String Functions and Proceduresp. 116
LENGTHp. 116
CONCATp. 117
COPYp. 117
POSp. 117
DELETEp. 117
INSERTp. 118
Summaryp. 119
Exercisesp. 119
Answersp. 120
Chapter 7 Program Architecturep. 121
7-1 Programs and Subprogramsp. 121
7-2 Proceduresp. 121
Procedure Definitionp. 122
Passing Values to Proceduresp. 123
Passing Back Values from Proceduresp. 126
7-3 Global and Local Variablesp. 127
Example: Sorting Procedurep. 127
7-4 Functionsp. 130
7-5 Tips on the Scope of Variablesp. 131
7-6 Recursionp. 133
Summaryp. 134
Exercisesp. 134
Answersp. 135
Chapter 8 Sets and Recordsp. 137
8-1 Setsp. 137
8-2 Set Declaration and Assignmentp. 138
Rules and Restrictionsp. 139
8-3 Set Operators and Operationsp. 140
Unionp. 140
Intersectionp. 140
Differencep. 140
Tips on Using Set Operatorsp. 140
Relational Operatorsp. 141
Example: Text Analyzerp. 142
8-4 Recordsp. 144
Record Declarationp. 144
Accessing Fieldsp. 145
The WITH Statementp. 146
8-5 Nesting Recordsp. 149
Summaryp. 151
Exercisesp. 152
Answersp. 153
Chapter 9 Files and Applicationsp. 155
9-1 Data Filesp. 155
9-2 TEXT Filesp. 156
9-3 Reading a TEXT Filep. 156
File Variablesp. 156
File Parametersp. 157
Opening a File for Input: RESETp. 157
Closing the Filep. 158
File Input Procedures: READ, READLNp. 158
The EOF and EOLN Functionsp. 159
Example: Disk-File Text Analyzerp. 159
9-4 Displaying a TEXT Filep. 162
Reading a TEXT File as a Set of Stringsp. 163
Reading Multiple Stringsp. 164
9-5 Creating a TEXT File: REWRITEp. 165
File Output Procedures: WRITE, WRITELNp. 165
Example: Employee Filep. 166
Example: Payrollp. 168
9-6 Non-TEXT Filesp. 172
Example: Payroll Systemp. 173
Appending a Filep. 176
9-7 Using the File Buffer Variablep. 178
Summaryp. 179
Exercisesp. 180
Answersp. 181
Chapter 10 Using Variant Recordsp. 183
10-1 Variant Recordsp. 183
10-2 Example: Enhanced Payroll Systemp. 185
10-3 Deleting Records from the Filep. 192
10-4 Updating Recordsp. 201
10-5 Enhance the Program Modularityp. 204
Suggestionsp. 214
Summaryp. 214
Exercisesp. 215
Answersp. 215
Chapter 11 Pointers and Linked Listsp. 217
11-1 Dynamic Memory Allocationp. 217
11-2 Pointersp. 217
Pointer Operationsp. 220
Pointers to Recordsp. 222
Passing Pointers as Parametersp. 224
11-3 Basics of Linked Listsp. 225
List Declarationp. 225
Building a Listp. 225
Reading a Listp. 227
Example: A Linked List Demop. 229
Storing Lists in Filesp. 232
Reading Lists from Filesp. 233
Example: A List of Recordsp. 234
11-4 Searching Listsp. 235
11-5 Deleting Nodes from Listsp. 243
Summaryp. 253
Exercisesp. 254
Answersp. 255
The Next Stepp. 256
Appendix A The ASCII Character Setp. 257
Appendix B Reserved Words and Standard Identifiersp. 261
Appendix C Answers to Drillsp. 265
Indexp. 317

Google Preview