Problem_Solving_and_Structured_Programming_in_Pascal_2ed_KOFFMAN_1985.pdf
(
28157 KB
)
Pobierz
Reference Guide to Pascal Statements
Statement
program heading
comment
Example of Use
program GUIDE (INPUT, OUTPUT, INFILE, OUTFILE);
[This section shows examples of Pascal statements.)
(*
Comments are ignored
by
Pascal.
*)
const
STRINGSIZE
=
20;
BLANK
= ' ';
SCHOOL
=
'TEMPLE UNIVERSITY' ;
DEANSLIST
=
3.5; PROBATION
=
1.0;
type
COLLEGE
=
(BUSINESS, ARTS, EDUCATION, GENERAL);
STUDENTRANGE
=
1 .. 100;
STRING
=
packed array [l .• STRINGSIZE]
of
CHAR;
CLASSPOINTER
=
ASTUDENT;
STUDENT
=
record
NAME : STRING;
GPA : REAL;
INCOLLEGE : COLLEGE;
NEXTSTU : CLASSPOINTER
end;
[STUDENT)
MAJORARRAY
=
array [STUDENTRANGE] of COLLEGE;
STUFILE
=
file of STUDENT;
GRADESET
=
set of 'A' .. 'Z';
var
CURSTU
STUDENT;
GRADES
GRADESET;
INFILE
TEXT;
OUTFILE : STUFILE;
CLASSLIST : CLASSPOINTER;
MAJOR: MAJORARRAY;
NEXTCH : CHAR;
I, COUNTPROBATION : INTEGER;
function MEMBER (NEXTCH : CHAR;
TESTSET : GRADESET)
BOOLEAN;
[Returns TRUE if NEXTCH is a member of TESTSET.)
begin (MEMBER)
MEMBER
:=
NEXTCH in TESTSET
end;
[MEMBERl
[Is NEXTCH in set?)
constant declaration
integer
character
string
real
type declaration
enumerated
subrange
string
pointer
record
array
file
set
variable declaration
record
set
text file
file
pointer
array
character
integer
declaring function
with BOOLEAN
result
assignment (BOOLEAN)
set membership
(continued on last page)
Problem Solving
and
Structured
Programming
in
Pascal
SECOND EDITION
Problem Solving
and
Structured
Programming
in
Pascal
SECOND EDITION
ELLIOT B. KOFFMAN
Temple University
yy
A
ADDISON-WESLEY PUBLISHING COMPANY, INC.
Reading, Massachusetts • Menlo Park, California •
Don Mills, Ontario
>
Wokingham, England> Amsterdam
Sydney>
Singapore· Tokyo
>
Mexico
City>
Bogota>
Santiago • San Juan
>
James T. DeWolf, Sponsoring Editor
Hugh Crawford, Manufacturing Supervisor
Robert Forget, Art Editor
Fran Palmer Fulton. Production Editor
Karen M. Guardino, Production Manager
Richard Hannus, Hannus Design Associates, Cover Design
Maureen Langer, Text Designer
Turbo Pascal0is a registered trademark of Borland International.
UCSD Pascale is a trademark of the Regents of the University of California.
Library of Congress Cataloging in Publication Data
Koffman. Elliot B.
Problem solving and structured programming in
Pascal.
Includes index.
1. Pascal (Computer program language) 2. Structured
programming.
I.
Title.
QA76.73.P2K63 1985
001.64'24
84-16811
ISBN 0-201-11736-3
ISBN 0-201-21450-4 School
Reprinted with corrections, June 1985
Copyright
©
1985. 1981 by Addison-Wesley Publishing Company, Inc. All rights re-
served. No part of this publication may be reproduced, stored in a retrieval sys-
tem, or transmitted in any form or by any means, electronic, mechanical,
photocopying, recording, or otherwise. without the prior written permission of the
publisher. Printed in the United States of America. Published simultaneously in
Canada.
BCDEFGHIJK-DO-898765
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