CodeWarrior_Programming_Practice_Pascal_1995_Metrowerks.pdf
(
2391 KB
)
Pobierz
Metrowerks
CodeWarrior
CD
CodeWarrior
Programming
Practice:
Pascal
TM
Because of last-minute changes to CodeWarrior, some information in this
manual may be out of date. Please read all the Release Notes files that come
with CodeWarrior for the latest information.
Metrowerks CodeWarrior Copyright ©1993-1995 by Metrowerks Inc. and its Licensors. All
rights reserved.
Documentation stored on the compact disc may be printed by licensee for personal use.
Except for the foregoing, no part of this documentation may be reproduced or transmitted in
any form by any means, electronic or mechanical, including photocopying, recording, or any
information storage and retrieval system, without permission in writing from Metrowerks Inc.
Metrowerks, the Metrowerks logo and Software at Work are registered trademarks of
Metrowerks Inc. CodeWarrior, PowerPlant, and PowerPlant Constructor are trademarks of
Metrowerks Inc.
All other trademarks or registered trademarks are the property of their respective owners.
ALL SOFTWARE AND DOCUMENTATION ON THE COMPACT DISC ARE SUBJECT
TO THE LICENSE AGREEMENT IN THE CD BOOKLET.
Canada and International
Metrowerks Inc.
1500 du College, suite 300
St. Laurent, QC
H4L 5G6 Canada
voice: (514) 747-5999
fax: (514) 747-2822
Metrowerks Mail Order
voice: (800) 377-5416 or (419) 281-1802
fax: (419) 281-6883
World Wide Web site (Internet): http://www.metrowerks.com
Registration information (Internet): register@metrowerks.com
Technical support (Internet):
Sales, marketing, & licensing (Internet):
AppleLink:
America OnLine:
support@metrowerks.com
sales@metrowerks.com
METROWERKS
goto: METROWERKS
U.S.A.
Metrowerks Corporation
Suite 310
The MCC Building
3925 West Braker Lane
Austin, TX 78759-5321
voice: 512-305-0400
fax: 512-305-0440
Compuserve: goto: METROWERKS
eWorld:
goto: METROWERKS
Table of Contents
iii
Table of Contents
Chapter 1 An Overview
1.1
1.2
Preview....................................................................14
Introduction to Programming Practice: Pascal...........15
A Global View.........................................................15
The Road Ahead.......................................................15
Signs Along the Road...............................................16
Hardware: Computers and Peripherals.....................17
The CPU...................................................................18
Other Components and Packaging............................19
The World of Programming......................................20
What is Programming?.............................................20
“Real world” and “Abstract World”..........................20
Pascal.......................................................................21
An example Pascal program......................................22
Running Programs: Compiling, Linking, Executing.23
Communicating to Computers..................................24
Typing......................................................................24
Chapter 1 Review.....................................................27
1.3
1.4
1.5
1.6
1.7
Chapter 2 Computing: A Short Survey of Some
Applications
2.1
2.2
2.3
Preview....................................................................30
Software and Applications........................................30
Application Software................................................33
Editor Application....................................................34
Typing Applications.................................................35
Calculator Applications.............................................36
Retrieve Application: A Tiny Database.....................38
Planner-Calendar Application...................................39
Bar Plot Application..................................................41
Drill Application.......................................................42
SSS: Small and Simple Spreadsheet...........................43
Chapter 2 Review.....................................................47
2.4
Chapter 3 Programming Language: Pascal
3.1
Preview....................................................................50
iv
Table of Contents
3.2
3.3
Languages................................................................50
Syntax and Semantics................................................50
Syntax Diagrams.......................................................53
Pascal Programs........................................................56
Program Format.......................................................56
Program Presentation................................................59
More Pascal Programming: Data and Actions..........60
Data Items................................................................61
Actions: Arithmetic Operations................................63
More Example Programs...........................................66
Chapter 3 Review.....................................................69
Chapter 3 Problems...................................................70
Chapter 3 Programming Project................................74
Getting Acquainted...................................................74
3.4
3.5
3.6
3.7
Chapter 4 Data and Actions
4.1
4.2
Preview....................................................................76
Programming: Data and Actions...............................76
Declarations: Syntax Diagrams from the Bottom........76
Simple Input and Output in Pascal............................80
More Programs: A Top View of Pascal....................83
Programming Style...................................................85
Layout of Programs..................................................86
More Programs: Continued.......................................89
Actions: Pre-Defined Standard Functions in Pascal....89
Libraries: Using Units in Pascal.................................92
A Foretaste of Procedures.........................................94
Chapter 4 Review.....................................................96
Chapter 4 Problems...................................................96
Chapter 4 Programming Projects...............................97
Generate Conversion Tables......................................97
Observing Errors......................................................97
Demilitarize Time.....................................................98
TipTable...................................................................99
STT: Sales Tax Table..................................................100
SSP: Simple Side Plot................................................101
4.3
4.4
4.5
4.6
4.7
4.8
4.9
4.10
Chapter 5 The Four Fundamental Forms
in Pascal
5.1
Preview....................................................................105
Table of Contents
v
5.2
5.3
5.4
5.5
5.6
5.7
The Sequence Form in Pascal....................................105
Conditions in Pascal..................................................107
Repetition Form: The WHILE statement....................108
Tracing Loops...........................................................110
WHILES, REALS, and Errors.....................................114
Selection Forms in Pascal..........................................117
More Selections: Combinations of Selection Forms....119
Confusion in Choices................................................120
More Nesting of Choices..........................................120
Alternative Ways to Code Selections.........................121
Select Form: Handling Many Branches....................124
5.8
5.9
Awkward Nests: General Nesting............................127
Mixed Nests: Repetition and Selections.....................128
5.10 Subprograms: Using Subprograms as Black Boxes....130
The ShortSort Library................................................134
Notation for Defined Procedures...............................137
Procedures vs. Functions..........................................140
5.11 Binary Logic Library: BitLib.....................................145
5.12 Chapter 5 Review.....................................................149
5.13 Chapter 5 Problems...................................................150
5.14 Chapter 5 Programming Problems............................152
Sequence Problems...................................................153
Selection Problems....................................................153
Loop Problems.........................................................153
Subprogram Problems..............................................153
Debugging Problems................................................154
Selection Programs...................................................156
Procedures and Repetitions.......................................157
Josephus’ Problem....................................................158
5.15 Chapter 5 Programming Projects...............................159
Project A: Change Change.......................................159
Project B: Payroll.....................................................160
Project C: Quadratic Roots.......................................160
Project D: Digital Circuits.........................................160
Project E: Roll Your Own.........................................161
CRN: Convert Roman Numbers..............................161
GPR: Growing Pay Roll...........................................161
MWM: Many Ways to Mid......................................162
DFP: Data Flow Programming.................................163
Chapter 6 Pascal with Bigger Blocks
6.1
Preview....................................................................169
Plik z chomika:
sdfg_ds
Inne pliki z tego folderu:
PASCAL_User_Manual_and_Report_1974_Jensen_Wirth.pdf
(6393 KB)
Pascal_ISO_7185_1990.pdf
(3976 KB)
A_Collection_of_Pascal_Programs_1979_Wirth.pdf
(1744 KB)
The_Programming_Language_Pascal_1970_Wirth.pdf
(2083 KB)
The_Programming_Language_Pascal_Revised_Report_1973_Wirth.pdf
(1931 KB)
Inne foldery tego chomika:
Algorithms
Artificial Intelligence
C
Compilers
Concurrency
Zgłoś jeśli
naruszono regulamin