← Macintosh Pascal

Macintosh Pascal

From the originals

13 scans

Machine-transcribed text and image descriptions. Check the linked original for uncertain words or fine print.

These are transcribed pages from the documents, not the full publications. Open the original for the remaining pages.

Image 1

Macintosh Pascal Moll/Folsom

A beige Macintosh computer with its screen showing a windowed interface and a wireframe sphere drawing sits against a dark blue background, with a keyboard and mouse in the foreground and the large white bold title at upper right.

Reading notes: Partially visible screen text on the monitor (e.g., 'Run Windows', 'Text', 'Drawing', 'lines do', 'time.)') is cut off by the frame edge and not transcribed as printed copy. Authors' names are printed as 'Moll/Folsom' with a slash and no spaces as shown.

Printed product names
Macintosh Pascal
Languages
English
PDF page 1

Macintosh Pascal Moll/Folsom

A beige Macintosh computer with a screen showing windows and a wireframe sphere drawing sits against a dark-to-blue background, with the title overlaid in large white type.

Reading notes: Partial screen text on the monitor (e.g., 'Run Windows', 'Drawing', 'Text', 'y time.', 'Lines do') is cut off and not transcribed as printed copy. Small text on the computer's back panel is not legible.

Printed product names
Macintosh Pascal
Languages
English
PDF page 2

Macintosh Pascal Standard Procedures Used in this Book Procedure Section Procedure Section close 11.10 open 11.10 delete 9.12 paintcircle 1.7 drawchar 7.6 paintoval 5.11 draw line 1.6 paintrect 5.7 eraseoval 5.11 pensize 11.1 eraserect 5.7 read 7.7 jrameoval 5.11 readln 3.6 framerect 5.7 reset 11.10 getmouse 7.11 seek 11.10 invertcircle 1.9 sysbeep 2.8 invertoval 5.11 write 3.8 invertrect 5.7 writedraw 5.9 lineto 11.1 writeln 1.3 moveto 5.9 Macintosh Pascal Standard Functions Used in this Book Function abs button chr copy eoj filepos length odd ord Section 4.14 8.6 7.9 10.1 11.10 11.11 9.10 5.11 7.1 Function pos pred random round sqr sqrt SUGG trunc Section 11.11 7.2 10.12 4.14 4.14 4.14 7.2 4.14

Reading notes: Some procedure names appear with OCR-like errors (e.g., 'jrameoval', 'SUGG') and may be misspelled in the source. Two-column reading order of the procedure and function tables may be ambiguous.

Languages
English
PDF page 3

Macintosh Pascal

A mostly blank, slightly yellowed page with a two-line bold serif title, 'Macintosh Pascal', centered near the top and no other artwork or layout elements.

Reading notes: Page shows aging stains and a faint handwritten mark in the top-right corner that is not transcribed; no body copy is visible.

Printed product names
Macintosh Pascal
Languages
English
PDF page 4

Macintosh Pascal

Macintosh Pascal Robert Moll University of Massachusetts, Amherst Rachel Folsom In Conjunction with THINK Technologies, Inc. Consultant: Mary Elting Houghton Mifflin Company Boston Dallas Geneva, Illinois Lawrenceville, New Jersey Palo Alto

Printed product names
Macintosh Pascal
Languages
English
PDF page 5

Macintosh is a trademark licensed to Apple Computer, lnci Copyright © 1985 by THINK Technologies, Inc. All right~ reserved. No part of this work may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying a;1d recording, or by any information storage or retrieval system, except as may ,,e expressly permit- ted by the 1976 Copyright Act or in writing by the Publisher. Requests for per- mission should be addressed to Permissions, Houghton Mif1lin Company, One Beacon Street, Boston, Massachusetts 02108. 1 Printed in the U.S.A. Library of Congress Catalog Card Number: 84-81937 ISBN: 0-395-37574-6 BCDEFGHIJ-H-898765

Reading notes: Several characters are damaged or substituted in the copyright and address lines, including 'lnci' and 'Mif1lin' and '~' and ';1d' and ',,e'. Catalog number '84-81937' and ISBN are printer codes rather than dates, so only 1985 and 1976 are treated as dates.

Printed product names
Macintosh
Printed dates
1985 · 1976 · 84-81937
Languages
English
PDF page 6

Contents Preface xi ----1 A First Look at Pascal 1------------- 1.1 Getting Started l 1.2 Taking a Look at Windows 6 1.3 The Instant Window 8 1.4 Quitting 13 1.5 Your First Program 13 1.6 Points , Lines , and the Drawing Window 16 1. 7 Circles 20 1.8 Stepping 22 l. 9 How to Move the Ball 23 1.10 Saving Your Program 27 1.11 Looping 29 1.12 Let's Get the Ball Rolling 31 1.13 Saving Your Revised Program 33 1.14 Printing Program Cartoon 33 1.15 The Nuts and Bolts of Programs 34 1.16 Pascal and Macintosh Pascal 35 Test Yourself 36 Problems 37 ---- 2 Machine Organization and Program Planning 43------ 2.1 Binary Numbers and Memory 43 2.2 Where Does MacPascal Fit In? 45 2.3 How Program Cartoon Is Stored in Memory 45 v

Reading notes: Source appears to be a table of contents with OCR spacing and character irregularities, e.g. 'l. 9' and '1. 7'; some entries may be misread.

Languages
English
PDF page 7

vi Contents 2.4 What Happens When You Run Program Cartoon 46 2.5 The Value of a Variable 47 2.6 Watching Variables with the Observe Window 47 2. 7 Arithmetic with Integers in MacPascal 53 2.8 Arithmetic and Looping 56 2.9 Solving Arithmetic Problems 58 2.10 Using Arithmetic in Program Explode 59 2.11 Planning a Graphics Program-Drawing Diamonds 60 2.12 Thinking, Planning, Testing, and Coding and Debugging 64 2.13 An Orbiting Planet 65 2.14 Getting the Planet to Return-Backward For Loops 69 2.15 Outside the Standard Drawing Window 70 2.16 Comments 72 2.17 Good Names, Bad Names, and Syntax Diagrams 73 Test Yourself 74 Problems 74 ____ 3 Syntax, Interactive Programs, and Real Numbers 79 ----- 3.1 Pascal Syntax-How to Beat the Bugs 79 3.2 What Is a Statement? 82 3.3 Syntax Notation 85 3.4 Nested Loops 87 3.5 Constants 88 3.6 Interactive Programs 90 3.7 More on Output-Fields and Field Widths 94 3.8 The Write Statement 97 3.9 Real Numbers 98 3.10 Writing Programs with Real Numbers 100 3.11 Getting Around Scientific Notation 101 3.12 Arithmetic with Real Numbers 102 3.13 Program HockeyScore-Planning an Interactive Program 103 3.14 Program Targets-Donuts and Bull's-eyes 106 Test Yourself 111 Problems 111 ---- 4 Assignment Statements and More on Looping 117 ----- 4. l Assignment Statements 117 4.2 The Staircase Problem 119 4.3 Back to Money-Compound Interest 122 4.4 The While Statement 124

Reading notes: Source is a table of contents, not an advertisement; no product names or prices present Stray spacing and hyphenation in some entries (e.g., 'Program Cartoon', 'Program HockeyScore') may reflect extraction artifacts

Languages
English
PDF page 8

Contents vii 4.5 While-Loop Pitfalls 128 4.6 Relationships and Relational Operators 129 4. 7 Longint-a Second Integer Type 130 4.8 While-Loop Syntax · 132 4.9 The Natural Superiority of the While Statement 133 4.10 Back to Double-Your-Money 133 4.11 Tests and Counters 135 4.12 Yet Another Way to Loop: Repeat-Until 138 4.13 The Pitfalls of the Repeat Loop 141 1 4.14 Math Formulas and Functions 142 Test Yourself · 148 Problems 148 ---- 5 Conditional Statements, Rectangles, and Bar Graphs 153 ___ 5.1 Conditional Statements-a Two-Number Sort 153 5.2 A Better Two-Number Sort-The Scratchpad Principle 155 5.3 If-Then-Else: Pascal's Other Conditionai Statement 157 5.4 The Case of the Dangling Else 162 5.5 The Mod Operator 162 5.6 A Math Puzzle 163 5. 7 Drawing Rectangles 167 5.8 Bar Graphs 171 5.9 Writing in the Drawing Window 175 5.10 A Compound-Interest Bar Graph Program 178 5.11 Oval Graphics 183 Test Yourself 188 Problems 188 ---- 6 Problem Solving with Procedures 191 --------- 6. l Creating Your Own Procedures 191 6.2 Executing Procedure Refrain 192 6.3 Program SquashedGlobe 193 I 6.4 Flexible Procedures-Procedures with Parameters 196 6.5 Procedures with Several Parameters 203 6.6 Procedures and Program Planning 207 6. 7 The Thermometer Problem 208 6.8 Creating a Checkerboard 214 Test Yourself 2~2 Problems 222

Reading notes: Source is a table of contents with OCR artifacts such as stray characters and split words (e.g., 'Conditionai', '---- 5') Heading for chapter 1 and some section numbering may be garbled

Languages
English
PDF page 9

viii Contents ____ 7 Enumerated Types, the Type Char, and More on Procedures 225 - 7 .1 Enumerated Types 225 7.2 Successor and Predecessor 228 7.3 Program WeekPlan-Using a Global Constant 229 7.4 The Case Statement 232 7. 5 The Type Char 236 7.6 Writedraw and Drawchar 239 7.7 Echoing in the Drawing Window-Read and Readln 240 7.8 Echoing a Whole Sentence to the Drawing Window 241 7.9 The Standard Function Chr 243 7.10 Variable Parameters 244 7.11 Getmouse-A MacPascal Standard Procedure 250 7 .12 Drawing with Getmouse 252 7.13 Cryptography 254 7.14 Creating a Secret Cipher 255 Test Yourself 262 Problems 262 ___ 8 The Type Boolean and Subrange Types 265 _______ 8.1 The Type Boolean: Pascal's True/Faise Type 265 8.2 Boolean Values and Tests 267 8.3 The Logical Connectives and, or, and not 268 8 .4 Flags 271 8.5 Matching Pareqtheses-A Proofreading Program 273 8.6 The Mouse Button 276 8. 7 Logic and Computers 279 8.8 The Truth Table 280 8.9 Truth Tables and Theorems 282 8.10 Subrange Types 285 Test Yourself 287 Problems 287 ____ g Arrays 289 _________________ 9.1 9.2 9.3 9.4 9.5 9.6 The Rutland Street Survey: A First Look at Arrays The Blueprint for an Array-Array Type Definitions Keeping a Running Total-Program PeopleOnBlock Finding the Largest Household 297 The Scoreboard Principle 298 Out-of-Range Errors-Program HowManyNeighbors 289 293 295 301

Reading notes: Source is a table of contents with Pascal programming chapter titles; no headline or advertised products present. Some hyphenation and spacing artifacts in OCR-like text (e.g., 'Pareqtheses', 'Faise', 'Getmouse').

Languages
English
PDF page 10

Contents ix 9. 7 Using an Array Variable as a Parameter for a Procedure 303 9.8 Rotating an Array-Program VolleyBall 305 9.9 Strings-Program TextEcho 308 9.10 More on Strings-Program PrintBackward 310 9.11 An Array of Strings-Program RμtlandStRoster 311 9.12 The Palindrome Problem 313 9.13 A Universal Line Graph Procedure 318 9.14 Pascal's Triangle 323 Test Yourself 330 Problems 330 ----10 Functions and Random Numbers 333 -------- 10.1 Standard Functions: A Review 333 10.2 Creating Your Own Functions 335 10.3 How to Declare Your Own Functions 336 10.4 Program PointlnRec-Preparing for Mouse Control 337 10.5 Function Capitalize 340 10.6 Another Math Puzzle-Finding Perfect Numbers 343 10.7 Passing an Array to a Function-Program ReportHottestDay 345 10.8 A Planning Example-Program LetterFrequency 347 10.9 Program WordFrequency 355 10.10 Sorting and Alphabetizing 361 10 .11 A Brief Look at Recursion 366 10.12 Random Numbers 368 10.13 Simulating a Coin Toss 369 10.14 The Monte Carlo Method 376 10.15 Estimating Pi with the Monte Carlo Method 377 10.16 Using Random Numbers to Test Programs 380 Test Yourself 384 Problems 384 ----11 Advanced Topics: The Mouse, Records, and Files 381---- 11.1 Program MiniPaint 387 11. 2 Records 398 11.3 Record Syntax 400 11.4 Program Checks 401 11.5 Employee Records 404 11.6 Arrays of Records 405 11. 7 :J:>rogram ReflectOvals 407 11.8 The With Statement 411

Reading notes: Possible OCR error in 'RμtlandStRoster' (likely 'RutlandStRoster') Section numbering around 'Problems' and chapter 11 heading is garbled

Languages
English
PDF page 11

X Contents 11.9 Files 414 11.10 Random-Access File Commands 414 11.11 The Last Program-Program PhoneBook 424 Test Yourself 435 Problems 435 Glossary 439 Answers to Exercises and Selected Problems 445 Index to Programs 489 Index 491

Reading notes: Source appears to be a table of contents, with no advertised products, prices, or dates. Headline cannot be confirmed as a primary heading from the supplied copy.

Languages
English