100% found this document useful (2 votes)
50 views

Computer Science A Structured Approach Using C Behrouz A. Forouzan 2024 Scribd Download

Forouzan

Uploaded by

toonekuppen8
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
50 views

Computer Science A Structured Approach Using C Behrouz A. Forouzan 2024 Scribd Download

Forouzan

Uploaded by

toonekuppen8
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 71

Visit https://ebookgate.

com to download the full version and


explore more ebooks

Computer Science A Structured Approach Using C


Behrouz A. Forouzan

_____ Click the link below to download _____


https://ebookgate.com/product/computer-science-a-
structured-approach-using-c-behrouz-a-forouzan/

Explore and download more ebooks at ebookgate.com


Here are some recommended products that might interest you.
You can download now and explore!

Cryptography Network Security 1st Edition Behrouz Forouzan

https://ebookgate.com/product/cryptography-network-security-1st-
edition-behrouz-forouzan/

ebookgate.com

Computer Science A Concise Introduction 2nd Edition


Sinclair

https://ebookgate.com/product/computer-science-a-concise-
introduction-2nd-edition-sinclair/

ebookgate.com

101 Design Methods A Structured Approach for Driving


Innovation in Your Organization Vijay Kumar

https://ebookgate.com/product/101-design-methods-a-structured-
approach-for-driving-innovation-in-your-organization-vijay-kumar/

ebookgate.com

Practical programming An introduction to computer science


using Python Jennifer Campbell

https://ebookgate.com/product/practical-programming-an-introduction-
to-computer-science-using-python-jennifer-campbell/

ebookgate.com
Supply Chain Project Management A Structured Collaborative
and Measurable Approach 1st Edition James B. Ayers

https://ebookgate.com/product/supply-chain-project-management-a-
structured-collaborative-and-measurable-approach-1st-edition-james-b-
ayers/
ebookgate.com

Computer Networks A Systems Approach 3rd Edition Larry L.


Peterson

https://ebookgate.com/product/computer-networks-a-systems-
approach-3rd-edition-larry-l-peterson/

ebookgate.com

C for Computer Science and Engineering 4th Edition Vic


Broquard

https://ebookgate.com/product/c-for-computer-science-and-
engineering-4th-edition-vic-broquard/

ebookgate.com

Computer Ethics A Case based Approach 1st Edition Robert


N. Barger

https://ebookgate.com/product/computer-ethics-a-case-based-
approach-1st-edition-robert-n-barger/

ebookgate.com

Structured surfaces as optical metamaterials 1st Edition A


A Maradudin

https://ebookgate.com/product/structured-surfaces-as-optical-
metamaterials-1st-edition-a-a-maradudin/

ebookgate.com
COMPUTE R SCIENCE
A Structured Programming Approach Using C
Behrouz A . Forouzan & Richard F. Gilberg

— THIRD EDITION
Operator Description Example * Assoc Pr
Identifiers amount
3.14159 N N /A 16
' Constants
Parenthetical Expressions (a + b)
[ ]. Array Index ary[i] N
ninction Call doIt(x, y) Y
Direct Member Selection str.mem N Left - Right 16
-> Indirect Member Selection ptr >mem - N
++ Postfix Increment • Decrement a++ Y
++ Prefix Increment • Decrement ++a Y
sizeof Size in Bytes sizeof(int) N

!
Ones Complement
Not
-a
la
N
N Right - Left 15
+ Plus • Minus +a N
& Address &a N
* Dereference / Indirection *ptr N
( )Type Cast (int)ptr N Right -Left 14
* /% Multiply • Divide • Modulus a * b N Left - Right 13
+ - Addition • Subtraction a + b N Left - Right 12
« » Bit Shift Left • Bit Shift Right a << 3 N Left - Right 1 1
< <= > >= Comparison a < 5 N Left - Right 10
ss ! = Equal • Not Equal N Left - Right 9
a == b
& Bitwise And a & b N Left - Right 8
A
Bitwise Exclusive Or a
A
b N Left - Right 7
Bitwise Or a b N Left - Right 6
&& Logical And a b ScSc N Left - Right 5
Logical Or a b N Left - Right 4
? : Conditional a ? x • Y * N Right - Left 3
= + = -= a = 5
*= / = % =
Assignment a %= b
>> =
A
<< =
a &= c Y Right - Left 2
& = = a |= d
> Comma a, b, c N Left - Right 1 i
* Side Effects ( Yes / No )

Precedence Table
>H
' . '

i -t X .U 6
\/o
*+ - - M i | J, -
' X AH .v A f\ £ w \/ dUe
Computer Science:
A Structured Programming
Approach Using C,
Third Edition
DATE DUE

Nov o 5 rm
LI 2o / H
1ft
March
/tprt I a ao\ ( p

2-6 ^6
AA 3 Z7
^i y
Wt ~ 7 IS7 %
JW 3 0 2( 17 <15

i m 1 o : Qi8 Clb
DEC 17 BtS
fa
IAUG 0 ! 2012
»7

Singapore • Spam • United Kingdom •United States


Australia •Brazil • Japan • Korea •Mexico •

SAN JACIN1U COLLEGE LIBHAHY- SOUTH


Preface to Third Edition

basic principles ol program -


This text has two primary objectives: to teach the
_ curriculum for a CS 1 class and to teach the
ming as outlined in the ACM
of the C Language . Our text puts these objectives in the con -
basic constructs
have developed through
text of good software engineering concepts that
we
more than 30 years of experience in industry and academia .

Major Changes in Third Edition


This is a major change from the second edition . In addition to significant
changes in the presentation and material covered , it also updates the lan -
guage to the ISO / IEC 9899 ( 1999 ) , or as it is more commonly known , C 99 .
While we have made major changes, we have held true to our primary
objectives as outlined above. I he text remains a comprehensive introduction
to computer programming in a software engineering context.
The major changes are outlined in the following sections.

Standard C ( 1999 )
I he following topics, in alphabetical order, are explicitly discussed in the text .
• the Boolean type
• character set extensions ( including Unicode and wide-characters)
• complex arithmetic
• extended math library
• for statement declarations
• integer type extensions
• line comments

Extended Chapter Material


In addition to the changes required by the inclusion of the new C99 exten
sions , several chapters have been revised or reorganized .
-
-
A new section in Chapter 4, Inter Function Communication , ” provides a
better understanding of how functions communicate.

IV
Preface to Third Edition v

• The concept of “ incremental program development ’ is presented through


an example that starts in Chapter 4 and is extended in C hapter 5 . A sec -
ond example in Chapter 8 completes the discussion .
• The discussion of text and binary files has been reworked to present the
materials in a more logical, and less redundant, fashion .
• The presentation of structured types is changed to conform to C 99 and
common usage.
• Chapter 14 . “ Bitwise Operators , " has been extended and includes more
examples. In particular, we added several applications related to the
Internet and network programming.
• Chapter 15 , " Lists , " has also been extended . It now includes an overview
of the basic elements of data structures, including introductory discus-
sions of stack, queues, lists , trees , and graphs.
• Additional flowcharts and structure charts are included throughout the
text to provide better design considerations for some of the more complex
examples.
• Appendix D , " Numbering Systems," provides an expanded presentation of
the material.
• Appendix 1, " Pointers to void and to Functions ," has been expanded to
include a discussion of using pointer to void types.
• Appendix k . " Program Development , ” is a new discussion of program
deve lop men t co n cepts.
• Appendix L , “ Understanding Complex Declarations ," contains the discus-
sion on reading complex declarations, which has been removed from
Chapter 10.

A C Language Perspective
While C is a complex and professional language, our classroom experience
using the previous editions of this book has shown that beginning students can
easily understand it . We believe that if the language is put into a perspective
that allows the student to understand its design , C is not a difficult language.
There are two aspects of C that separate it from most other languages:
expressions and pointers. The concept of expressions, as used in C , is unique.
The first half of this text builds a firm understanding of expressions. We intro-
duce pointers only to the extent necessary to cover passing them to functions
7

in Chapter 4 and arrays in Chapter 8. Our experiences have shown that with
a firm grasp of the expression concept , much of the mystery of C disappears.
In Chapters 9 , we begin to develop the concept of pointers, which are
further developed in Chapter 10. Chapter 1 1 provides a discussion of C’s
approach to strings. Finally, Chapter 14 provides an extensive discussion of
bitwise operators, a subject that is needed to make the book complete.
The last chapter is a simple introduction to data structures. While not
all courses will have time to cover this chapter, those that do will give the
ce to Third Edition

students a head start into data structures


. Motivated students will find that
over the term break.
they can "get a leg up” on data structures
a rich set of references to
The appendices at the end of the text comprise
subjects required in the complete C language
. These will be of use to stu -
dents who go on to take other courses in the C language .

Features of the Book


Several features of this book make it unique and easy for beginning students
to understand .

Structure and Style


One of our basic tenets is that good habits are formed early. The corollary is
that bad habits are hard to break. Therefore, we consistently emphasize the
principles of structured programming and software engineering. Throughout
each chapter, short code snippets and programs are used to demonstrate
techniques.
Complete programs, generally found in the last section of the chapter,
are written in a well - document consistent style. As programs are analyzed,
style and standards are further explained . While we acknowledge that there
are many good styles, our experience has shown that if students are exposed
to one good style and adopt it , they will be better able to adapt to other
good styles.

Principle Before Practice


Whenever possible, we develop the principle ot a subject before we introduce
the language implementation . For example , in Chapter 5 we first introduce
the concept of logical data and selection and then we introduce the if . . . else
and suitch statements. This approach gives the student an understanding of
selection before introducing the nuances of the language.

Visual Approach
A brief scan of the hook will demonstrate that our approach is visual . 1 here
are more than 400 figures, plus more than 70 tables and 180 program exam -
pies. While this amount of material tends to create a large hook, the visual
approach makes it easy for students to follow the material .

Examples
While the programming examples vary in
style. Our experience
complexity, each uses a consistent
working with productional programs that live for 10 to
20 years convinced us that
readable and understandable programs are easier
to work with than programs
written in a terse, cryptic manner. For that reason ,
Preface to Third Edition vii

and to emphasize the structure of the language, we label the sections in a


function with comments. We consistently follow a style that places only one
declaration, definition, or statement on a line.
I he source code for these programs is available on the Course Technology
Web site ( see ’Web Site Support Materials” later in this Preface). Students are
able to run these programs and to explore related topics through modification
and experimentation.

Coding Techniques
Throughout the text we include coding techniques that make programs more
readable and often more efficient. For example, in the analyTsis of Program 5 - 4
you will find the following discussion:
Where do we check for greater than } The answer is that we
default the greater than condition to the outer else . . . . When cod -
ing a two - way selection statement , try to code the most probable
condition first; with nested selection statements, code the most
probable first and the least probable last.
These techniques are drawn from our extensive industry and classroom
experience.

Software Engineering
A discussion of software engineering principles concludes each chapter. Our
intent is not to replace a separate course in software engineering. Rather, we
firmly believe that by incorporating basic software engineering principles
early in their studies, students will be better prepared for a formal treatment
of the subject . Even more important, by writing well-engineered programs
from the beginning, students will not be forced to unlearn and relearn. I hey
will better understand software discussions in their subsequent classes.
While the software engineering sections are found at the end of each
chapter, they are most successfully taught by introducing them as the chapter
unfolds. Then, a short review at the end of the chapter summarizes the prin-
ciples that have been demonstrated during the lectures.
These sections are visually distinguishable from the rest of the chapter.
They have been set apart for several reasons. First, they are in reality a small
book within a book. While these sections contain important material, the book
stands on its own without them. You may, therefore, decide to cover the soft -
ware engineering sections as formal lecture topics or informally while the
chapter material is being covered. You may decide to assign them to the stu -
dent as additional reading, or, you may decide to exclude them entirely from
the course.
In general, software engineering sections directly or indirectly pertain to
the chapter material. Where they don’t, they discuss general software engi-
neering subjects, such as cohesion, coupling, and quality.
vjjj Preface to Third Edition

Pedagogical Material
first , it helps the stu -
End chapter material meets two pedagogical objectives:
dents to review or summarize what they have learned , and second , it tests the
students’ mastery of the chapter material .

Review Material
• Tips and Common Programming Errors points out helpful hints and
possible problem areas.
• Key Terms provides a list of the important terms introduced in the chapter.
• Summary contains a concise overview of the key points for students to
understand in the chapter.

Practice Sets
• Review Questions contain several multiple choice questions that are
similar to the questions found in the examination database. The answers
to the odd - numbered questions are included in the solutions on the
Course Technology web site .
• Exercises are short questions covering the material in the chapter. The
answers to the odd - numbered exercises are also included in the solutions
on the Course Technology web site.
• Problems are short coding problems, generally intended to be run on a
computer. They can usually be developed in two to three hours. Once
again , odd - numbered solutions are found on the web site .
• Projects are longer, major assignments that may take the average student
six to nine hours to develop.

Appendices and Cover Material


Ilu appendices are intended to provide quick reference material , such as the
Unicode Character Set , or to provide a review of material, such as numbering
systems , usually covered in a general computer class .
I he inside covers contain two important references
that are used con -
I / O Codes . —
tinually throughout the course the Precedence Table and the
Formatted

Web Site Support Materials


'1 <~ Hl" St lechn logy Web site ( http://www.course.com ) are
twn sets off materials
|
, one for the°professor and one for
the student .
1
Preface to Third Edition ix

Professor Materials
The professors materials include the solutions to all review questions, exer-
cises , and problems. Because the projects are more complex assignments lor
which there is no standard answer, we do not provide solutions for them .
In addition to the end - material solutions , there are three other sets ol
support materials: ( 1 ) Copies of all programs in the text. The programs have
been extensively tested on at least two different computers with different
operating systems. All of them conform to the C99 Standard.
( 2 ) PowerPoint materials covering objectives, figures, programs, impor -
tant points , and chapter summaries. The PowerPoint materials can be used as
is or edited to suit individual class needs. This flexibility allows professors to
argument the text materials with their own . It also allows them to rearrange
the materials to suit their individual needs and style .
( 3) New with the third edition is the availability of ExamView®. This
objective- based test generator lets the professor create paper, LAN , or Web-
based tests from testhanks designed specifically for this text . Using the
QuickTest Wizard , they can easily and quickly create true/false and multiple -
choice tests. It is also possible to add questions that cover supplemental
material provided by the professor.

Student Materials
I he student materials include the solutions to the odd - numbered review
questions , exercises , and problems. They also have access to the copies of the
programs used in the text

Acknowledgments
No book of this scope can he developed without the support ol many people.

Reviewers
To anyone who has not been through the process, the value ol peer reviews
cannot he appreciated enough . Writing a text rapidly becomes a myopic pro -
cess. The important guidance of reviewers who can stand hack and review the
text as a whole cannot be measured. We would especially like to acknowledge
the contributions of the reviewers of all three editions.
Stephen Allen , Utah State University
Mary Astone, / roy State University
Ali Behforooz, Towson State University
George Berrv, Wentworth Institute oj technology
Ernest Carey, Utah Valley State College
Ping Chu Chu , Fayetteville State University
Preface tojhird Edition
r
of San Francisco
Constance Conner, City College
Connecticut State University
John S. DaPonte, Southern University
Maurice L. Eggen , Trinity
/

Peter Gabrovsky, CSU Northridge


Robert Gann , Hartwick College
Henry Gordon , Kutztown University
Rick Graziani , Cabrillo College
Barbara Guillott , Louisiana State University
Jerzy Jaromczyk, University of Kentucky
John Kinio, Humber College
Roberta Klibaner, College of Staten Island
Joseph A. Konstan , University of Minnesota
Krishna Kulkarni, Rust College
John Lowther, Michigan Technological University
Mike Michaelson , Palomar College

Kara Nance, University of Alaska Fairbanks
Ali Nikzad , Huston -Tillotson College
Jo .Ann Parikh , Southern Connecticut State University
Mark Parker, Shoreline Community College
Savitha Pinnepalli, Louisiana State University
Oskar Reiksts, Kutztown University
Jim Roberts, Carnegie Mellon University
Ali Salenia, South Dakota State University
Larry Sells, Oklahoma City University
Shashi Shekhar, University of Minnesota
Robert Signorile, Boston College
Brenda Sonderegger, Montana State University
Deborah Sturm , College of Staten Island
Venkat Subramanian . University of Houston
John B. Iappen , University of Southern Colorado
Marc Thomasm , California State University, Bakersfield
John Irono, St . Michael 's College
K C. Wong, Fayetteville State University

Course Technology Staff


Our thanks to our editors , Alyssa Pratt , Senior Product Manager, and Mary
hranz , Senior Acquisitions Editor, for helping us produce the book. We are
also indebted to the Quality Assurance staff who diligently double checked
-
each c aP er anc program. Our thanks to Burt LaFountain , Serge Palladino,
^ ^ ’ .^
and Chris Sc river *
• ^^
W< U aS
? Mitchell
cially Sandra
° to diank the staff at GEX Publishing Services , espe-
, who ably guided the book through production .

BehrouzA. Forouzan
Richard F. Gilberg
1

Chapter 1 Introduction to Computers 1


1.1 Computer Systems 2
Computer Hardware 2
Computer Software 3
1.2 Computing Environments 5
Personal Computing Environment 5
Time-Sharing Environment 5
Client/Server Environment 6
Distributed Computing 7
1.3 Computer Languages 7
Machine Languages 8
Symbolic Languages 9
High-Level Languages 10
1.4 Creating and Running Programs 11
Writing and Editing Programs 12
Compiling Programs 12
Linking Programs 12
Executing Programs 13
1.5 System Development 13
System Development Life Cycle 13
Program Development 14
1.6 Software Engineering 22
1.7 Tips and Common Errors 24
1.8 Key Terms 24
1.9 Summary 25
1.10 Practice Sets 26
Review Questions 26
Exercises 28
Problems 28
29
Chapter 2 Introduction to the C Language
2.1 Background 30
2.2 C Programs 31
Structure of o C Program 31
Your First C Program 32
Comments 34
The Greeting Program 35
2.3 Identifiers 36
2.4 Types 38
Void Type 38
Integral Type 38
Floating-Point Types 41
Type Summary 42
2.5 Variables 42
Variable Declaration 43
Variable Initialization 44
2.6 Constants 4/
Constant Representation 47
Coding Constants 51
2.7 Input/Output 53
Streams 53
Formatting Input/Output 54
2.8 Programming Examples 68
2.9 Software Engineering 77
Program Documentation 77
Data Names 78
Data Hiding 79
2.10 Tips and Common Programming Errors 81
2.11 Key Terms 82
2.12 Summary 82
2.13 Practice Sets 84
Review Questions 84
Exercises 86
Problems 89
Projects 90

Chapter 3 Structure of a C Program 93


3.1 Expressions 94
Primary Expressions 95
Postfix Expressions 95
Prefix Expressions 97
1
Contents xiii

Unary Expressions 99
Binary Expressions 101
3.2 Precedence and Associativity 106
Precedence 107
Associativity 108
3.3 Side Effects 110
3.4 Evaluating Expressions 111
Expressions without Side Effects 111
Expressions with Side Effects 112
Warning 113
3.5 Type Conversion 114
Implicit Type Conversion 114
Explicit Type Conversion (Cast) 118
3.6 Statements 120
Statement Type 120
The Role of the Semicolon 124
Statements and Defined Constants 124
3.7 Sample Programs 125
3.8 Software Engineering 135
KISS 135
Parentheses 135
User Communication 136
3.9 Tips and Common Errors 138
3.10 Key Terms 138
3.11 Summary 139
3.12 Practice Sets 140
Review Questions 140
Exercises 142
Problems 144
Projects 146

Chapter 4 Functions 149


4.1 Designing Structured Programs 150
4.2 Functions in C 151
4.3 User -Defined functions 155
Basic Function Designs 156
Function Definition 162
Function Declaration 164
The Function Call 165
Function Examples 166
Contents xv
'
5.3 Multiway Selection 254
The switch Statement 255
The else-if 261
5.4 More Standard Functions 264
Standard Characters Functions 264
A Classification Program 266
Handling Major Errors 268
5.5 Incremental Development Part II 268
Calculator Design 269
Calculator Incremental Design 269
5.6 Software Engineering 280
Dependent Statements 280
Negative Logic 281
Rules for Selection Statements 282
Selection in Structure Charts 283
5.7 Tips and Common Programming Errors 285
5.8 Key Terms 286
5.9 Summary 286
5.10 Practice Sets 287
Review Questions 287
Exercises 289
Programs 294
Projects 295

Chapter 6 Repetition 303


6.1 Concept of a loop 304
6.2 Pretest and Post-test Loops 304
6.3 Initialization and Updating 306
Loop Initialization 306
Loop Update 306
6.4 Event- and Counter-Controlled Loops 308
Event-Controlled Loops 308
Counter-Controlled Loops 308
Loop Comparison 309
6.5 Loops in C 309
The while Loop 310
The for Loop 315
The do . ..while Loop 319
The Comma Expression 323
6.6 Loop Examples 325
for Loops 325
Contents xvii

7.3 Standard Library Input/Output Functions 397


File Open and Close 398
7.4 Formatting Input/Output Functions 403
Stream Pointer 404
Format Control Strings 404
Input Formatting ( scantand fsconf ) 406
Output Formatting ( printf and fprintf) 418
File Sample Programs 425
7.5 Character Input/Output Functions 432
Terminal Character I/O 433
Terminal and File Character I/O 434
Character Input/Output Examples 436
7.6 Software Engineering 442
Testing Files 442
Data Terminology 445
7.7 Tips and Common Programming Errors 447
7.8 Key Terms 448
7.9 Summary 448
7.10 Practice Sets 449
Review Questions 449
Exercises 451
Problems 453
Projects 455

Chapter 8 Arrays 459


8.1 Concepts 460
8.2 Using Arrays in C 463
Declaration and Definition 463
Accessing Elements in Arrays 464
Storing Values in Arrays 465
Precedence of Array References 469
Index Range Checking 470
8.3 Inter -Function Communication 473
Passing Individual Elements 473
Passing the Whole Array 475
8.4 Array Applications 481
Frequency Arrays 481
Histograms 482
Random Number Permutations 487
8.5 Sorting 490
Selection Sort 491
Bubble Sort 493
Insertion Sort 496
Testing Sorts 499
Sorts Compared 500
Sort Conclusions 500
8.6 Searching 501
Sequential Search 501
Binary Search 505
8.7 Two-Dimensional Arrays 509
Declaration 510
Passing a Two-Dimensional Array 516
8.8 Multidimensional Arrays 519
Declaring Multidimensional Arrays 520
8.9 Programming Example-Calculate Averages 522
First Increment: main 523
Second Increment: Get Data 524
Third Increment: Calculate Row Averages 526
Fourth Increment: Calculate Column Averages 528
Fifth Increment: Print Tables 528
8.10 Software Engineering 532
Testing Sorts 532
Testing Searches 532
Analyzing Sort Algorithms 533
Analyzing Search Algorithms 535
8.11 Tips ond Common Programming Errors 537
8.12 Key Terms 538
8.13 Summory 538
8.14 Practice Sets 540
Review Questions 540
Exercises 542
Problems 545
Projects 550

Chapter 9 Pointers 557


9.1 Introduction 558
Pointer Constants 558
Pointer Values 559
Pointer Variables 561
Accessing Variables Through Pointers 562
Pointer Declaration and Definition 563
Declaration versus Redirection S65
Initialization of Pointer Variables 566
9.2 Pointers for Inter-Function Communication 573
Passing Addresses 573
Functions Returning Pointers 575
Contents xix

9.3 Pointers to Pointers 576


9.4 Compatibility 578
Pointer Size Compatibility 579
Dereference Type Compatibility 580
Dereference Level Compatibility 583
9.5 Lvalue and Rvalue 583
Pointer Examples 585
9.6 Software Engineering 593
Quality Defined 593
Quality Factors 594
The Quality Circle 597
Conclusion 598
9.7 Tips and Common Programming Errors 599
9.8 Key Terms 600
9.9 Summary 600
9.10 Practice Sets 601
Review Questions 601
Exercises 604
Problems 607
Projects 608

Chapter 10 Pointer Applications 611


10.1 Arrays and Pointers 612
10.2 Pointer Arithmetic and Arrays 614
Pointers and One-Dimensional Arrays 614
Arithmetic Operations on Pointers 617
Using Pointer Arithmetic 618
Pointers and Two-Dimensional Arrays 621
10.3 Passing an Array to a Function 623
10.4 Memory Allocation Functions 627
Memory Usage 627
Static Memory Allocation 628
Dynamic Memory Allocation 628
Memory Allocation Functions 628
Reallocation Of Memory ( realloc) 631
Releasing Memory ( fee) 631
10.5 Array of Pointers 633
10.6 Programming Applications 634
Selection Sort Revisited 634
Dynamic Array 639
Contents xxi
1
String to Number 704
String Examples 707
11.6 String/Data Conversion 712
String to Data Conversion 713
Data to String Conversion 714
11.7 A Programming Example — Morse Code 718
11.8 Software Engineering 728
Program Design Concepts 728
Information Hiding 728
Cohesion 728
Summary 732
11.9 Tips and Common Programming Errors 733
11.10 Key Terms 734
11.11 Summary 734
11.12 Practice Sets 735
Review Questions 735
Exercises 737
Problems 740
Projects 742

Chapter 12 Enumerated, Structure, and Union Types 745


12.1 The Type Definition ( lypedef ) 746
12.2 Enumerated Types 746
Declaring an Enumerated Type 74 7
Operations on Enumerated Types 748
Enumeration Type Conversion 749
Initializing Enumerated Constants 749
Anonymous Enumeration: Constants 750
Input/Output Operations 752
12.3 Structure 752
Structure Type Declaration 753
Initialization 755
Accessing Structures 756
Operations on Structures 759
Complex Structures 764
Structures and Functions 774
Sending the Whole Structure 7 7 5
Passing Structures Through Pointers 7 7 8
12.4 Unions 782
Referencing Unions 782
Initializers 782
Contents xxiii

13.7 Key Terms 867


13.8 Summary 867
13.9 Practice Sets 868
Review Questions 868
Exercises 870
Problems 876
Projects 877

Chapter 14 Bitwise Operators 881


14.1 Exact Size Integer Types 882
14.2 Logical Bitwise Operators 882
Bitwise and Operator 882
Bitwise Inclusive or Operator 884
Bitwise Exclusive or Operator 885
One's Complement Operator 886
14.3 Shift Operators 889
Rotation 894
14.4 Masks 896
Creating Masks 896
Using Masks 898
14.5 Software Engineering 907
Payroll Case Study 907
Program Design Steps 908
Structure Chart Design 908
14.6 Tips and Common Programming Errors 914
14.7 Key Terms 915
14.8 Summary 915
14.9 Practice Sets 916
Review Questions 916
Exercises 917
Problems 920
Projects 921

Chapter 15 Lists 927


15.1 List Implementations 928
Array Implementation 928
Linked List Implementation 928
15.2 General Linear Lists 930
Insert a Node 930
Delete a Node 935
Locating Data in Linear Lists 938
Traversing linear Lists 941
Building a linear List 943
Build List 944
Remove a Node 945
Linear List Test Driver 946
15.3 Stacks 949
Stack Structures 950
Stack Algorithms 951
Stack Demonstration 954
15.4 Queues 958
Queue Operations 958
Queue Linked List Design 960
Queue Functions 961
Queue Demonstration 964
15.5 Trees 96 /
Basic Tree Concepts 96 /
Terminology 968
Binary Trees 969
Binary Search Trees 9 / 5
Binary Tree Example 9 / 8
15.6 Graphs 981
Graph Traversal 983
15. / Software Engineering 986
Atomic and Composite Data 986
Data Structure 98 /
Abstract Data Type 987
A Model for an Abstract Data Type 989
ADT Data Structure 990
15.7 Tips and Common Programming Errors 991
15.8 Key Terms 992
15.9 Summary 992
15.10 Practice Set 994
Review Questions 994
Exercises 996
Problems 1000
Projects 1002

Appendix A Character Sets 1005


A .l Unicode 1006
Planes 1006
A.2 ASCII 1009
Some Properties of ASCII 1014
A. 3 Universal Encoding in C 1015
Contents xxv

Appendix B Keywords 1017

Appendix C Flowcharting 1019


C.l Auxiliary Symbols 1019
Flow Lines 1020
Connectors 1021
C.2 Primary Symbols 1021
Sequence 1022
Selection Statements 1024
Looping Statements 1026

Appendix D Numbering Systems 1033


D.l Computer Numbering System 1033
Decimal Numbers ( Base 10) 1034
Binary Numbers (Base 2) 1034
Hexadecimal Numbers (Base 16) 1036
Base 256 1037
A Comparison 1038
Other Conversions 1039
D.2 Storing Integers 1040
Unsigned Integers 1040
Signed Integers 1041
Overflow 1047
D.3 Storing Real Numbers 1049
Normalization 1049
Sign, Exponent, and Mantissa 1051
IEEE Standards 1051
Storing and Retrieving Algorithm 1051

Appendix E Integer and Float Libraries 1055


E. l limits . h 1055
E .2 float .h 1056

Appendix F Function Libraries 1059


F.l Function Index 1059
F.2 Type Library 1062
F.3 Math Library 1063
F.4 Standard 1/0 Library 1065
General 1/0 1066
Formatted 1/0 1066
xxvi Contents

Character I/O 1066


File I/O 1067
String I/O 1067
System File Control 1067
F.5 Standard Library 1067
Math Functions 1067
Memory Functions 1068
Program Control 1068
System Communication 1068
Conversion Functions 1068
F.6 String Library 1068
Memory Functions 1068
String Functions 1069
F.7 Time Library 1069

Appendix G Preprocessor Commands 1071


G.l File Inclusion 1072
G.2 Macro Definition 1072
Coding Defined Constants 1073
Macros that Simulate Functions 1074
Nested Macros 1077
Undefining Macros 1078
Predefined Macros 1078
Operators Related to Macros 1079
G.3 Conditional Compilation 1080
Two-Way Commands 1081
Multi-Way Commands 1085
Summary of Conditional Commands 1086
G.4 Other Commands 1087
Line Command 1087
Error Command 1088
Pragma Command 1089
Null Command 1089

Appendix H Command-Line Arguments 1091


H.l Defining Command-Line Arguments 1091
H.2 Using Command-Line Arguments 1093

Appendix I Pointers to Void ond to Functions 1095


1.1 Pointer to void 1095
1.2 Pointer to Function 1097
Contents xxvii

Appendix J Storage Classes and Type Qualifiers 1103


J.l Storage Classes 1103
Object Storage Attributes 1103
Storage Class Specifiers 1105
J.2 Type Qualifiers 1111
Constants 1112
Volatile 1113
Restricted 1114

Appendix K Program Development 1115


K .l Process 1115
First Case: A Simple File 1115
Second Case: Two Functions 1117
Third Case: Two Source Files 1118
Case 4 : Separate Compilation of Function 1120
K.2 Coding 1121
UNIX 1121
Other Platforms 1124

Appendix L Understanding Complex Declarations 1125

Glossary 1129

Index 1145
t

I
Introduction to Computers
and
Welcome to computer science! You are about to explore a wonderful
exciting world — a world that offers many challengin g and
In this chapter, we introduce you to the concepts of computer
exciting careers .
science ,

especially as they pertain to computer programming . You will study the con -
cept of a computer system and how it relates to computer hardware
and soft -
ware. We will also present a short history of computer programmi ng
languages so that you understand how they have evolved and how the C lan -
guage fits into the picture.
We will then describe how to write a program , lirst with a review ot the
tools and steps involved , and then with a review of a system development
methodology.

Objectives
To review basic computer systems concepts
To be able to understand the different computing environments and
their
components
To review the history of computer languages
To be able to list and describe the classifications of computer language
s
To understand the steps in the development of a computer program
To review the system development life cycle

1
2 Section 1.1 Computer Systems

1.1 Computer Systems


everywhere. Computers have become
Today computer systems are found
. But what is a computer? A computer is a
almost as common as Ltelevisions
_
The com - .
components: hardware and software
system made of two major the collection of
puter hardware is the physical
equipment. The software is
the hardware to do its job . Figure I - 1 rep -
programs (instructions) that allow
resents a computer system .

Computer
System

Hardware Software

FIGURE 1 - 1 A Computer System

Computer Hardware
The hardware component of the computer system consists of five parts:
input devices, central processing unit (CPU ), primary storage, output
devices, and auxiliary storage devices (Figure 1 - 2 ).

Primary Monitor
Keyboard CPU
Storage
Input Devices

t
Printer
Auxiliary Storage Devices Output Devices

FIGURE 1 - 2 Basic Hardware Components

I he input device is usually a keyboard


where programs and data are
entered into the computer. Examples of other input
a pen or stylus, a touch screen, or an
devices include a mouse,
audio input unit.
The central processing unit (CPU) is
responsible for executing
instructions such as arithmetic calculations, comparisons among
data, and
Chapter 1 Introduction to Computers 3

one, tyvo ,
movement of data inside the system . Today’s computers may have
main memory is a place
or more CPUs. Primary storage , also known as
,

where the programs and data are stored temporarily during processing. The
data in primary storage are erased when we turn off a personal computer or
when we log off from a time -sharing computer.
The output device is usually a monitor or a printer to show output . If the
output is shown on the monitor, we say we have a soft copy. If it is printed
on
the printer, we say we have a hard copy .
Auxiliary storage, also known as secondary storage, is used for both
input and output. It is the place where the programs and data are stored per-
manently. When we turn off the computer, our programs and data remain in
the secondary storage, ready for the next time we need them .

Computer Software
Computer software is divided into two broad categories: system software and
application software. This is true regardless of the hardware system architec -
ture. System software manages the computer resources. It provides the inter-
face between the hardware and the users hut does nothing to directly serve
the users’ needs. Application software, on the other hand , is directly responsi -
ble for helping users solve their problems. Figure 1 - 3 shows this breakdown
of computer software .

Software

System Application
Software Software

Operating System System General Application


Systems Support Development Purpose Specific

FIGURE 1 - 3 Types of Software

System Software
System software consists of programs that manage the hardware resources
of a computer and perform required information processing tasks . These pro -
grams are divided into three classes: the operating system , system support
,
and system developme nt .
The operating system provides services such as a user interface, file and
database access, and interfaces to communication systems such as Internet
protocols. The primary purpose of this software is to keep the system operat -
.
ing in an efficient manner while allowing the users access to the system
System support software provides system utilities and other operating
services . Examples of system utilities are sort programs and disk format
4 Section 1.1 Computer Systems
perlormance
consist of programs that provide
programs. Operating services and security monitors to protect the system
statistics for the operational
staff
and data. software ,
, system development
The last system software category lan -
convert programs into machine
includes the language translators that ensure that the programs are error-
guage for execution , debugging tools
to
engineering ( CASE ) systems that
are
free , and computer-assisted software
beyond the scope of this hook .

Application Software
classes: general-purpose software
Application software is broken into two
purpose software is purchased
and application -specific software. General-
he used lor more than one application .
from a software developer and can
word processors , database
Examples of general - purpose software include
management systems, and computer-aided
design systems. I hey are labeled
computing problems.
general purpose because they can solve a variety of user
purpose.
Application -specific software can he used only for its intended
requirements
A general ledger system used by accountants and a material
are examples of
planning system used by a manufacturing organization
only for the task for which
application -specific software. They can he used
they were designed ; they cannot he used for other generaliz ed tasks .

The relationship between system and application software is seen in


Figure 1 - 4 . In this figure, each circle represents an interface point. The inner
core is the hardware . The user is represented by the outer layer. To work with
the system , the typical user uses some form of application software. The
application software in turn interacts with the operating system , which is a
part of the system software layer. The system software provides the direct
interaction with the hardware. Note the opening at the bottom of the fig ure .
This is the path followed hv the user who interacts directly with the operating
system when necessary.

User

Software
W

FIGURE 1 - 4 Relationship Between System and Application Software


Chapter 1 Introduction toComputers 5

If users cannot buy software that supports their needs , then a custom -
developed application must be built . In today’s computing environment , one
of the tools used to develop software is the C language that we will he study-
ing in this text .

1.2 Computing Environments


In the early days of computers , there was only one environment : the main -
frame computer hidden in a central computing department . With the advent
of minicomputers and personal computers, the environment changed , result -
ing in computers on virtually every desktop. In this section we describe sev -
eral different environments.

Personal Computing Environment


In 1971 , Marcian E. Hoff , working for Intel , combined the basic elements of
the central processing unit into the microprocessor. This first computer on a
chip was the Intel 4004 and was the grandparent many times removed of
Intel ’s current system .
If we are using a personal computer, all of the computer hardware com -
ponents are tied together in our personal computer ( or PC for short ) . In
1

this situation , we have the whole computer for ourself ; we can do whatever
we want . A typical personal computer is shown in Figure 1 - 5 .

Monitor
Hard Drive
(Internal)
DVD ^
CD
Keyboard Mouse

FIGURE 1 - 5 Personal Computing Environment

Time- Sharing Environment


Employees in large companies often work in what is know n as a time-sharing
environment . In the time-sharing environment , many users are connected to
one or more computers. These computers may be minicomputers or central
mainframes. The terminals they use are often nonprogrammable, although
today we see more and more microcomputers being used to simulate termi -
nals. Also, in the time sharing environment , the output devices ( such as
- ol the
printers ) and auxiliary storage devices (such as disks) are shared by all

operating
1 . PC is now generally accepted to mean any hardware using one of Microsoft s Windows

systems, as opposed to Apple ’s Macintosh. We use it in the original , generic


sense meaning any per -
sonal computer.
6 Section 1.2 Computing Environments
is shared by many stu -
in which a minicomputer
users. A typical college lab
dents is shown in Figure 1 -
6.

Central Computer
Central Storage

Shared Printers

FIGURE 1 - 6 Time- sharing Environment

In the time-sharing environment , all computing must he done


hy the cen -
the central computer has many duties : It must
tral computer. In other words ,
control the shared resources ; it must manage the shared data and printing;
and it must do the computin g. All of this work tends to keep the computer
busy. In fact , it is sometimes so busy that the user becomes frustrated hy the
computers slow responses.

Client/Server Environment
A client/server computing environment splits the computing function
between a central computer and users’ computers. The users are given per-
sonal computers or workstations so that some of the computation responsi -
bility can he moved Irom the central computer and assigned to the
workstations. In the client/server environment , the users’ microcomputers or
workstations are called the client . The central computer, which may be a
powerful microcomputer, minicomputer, or central mainframe system , is
known as the server. Because the work is now shared between the users
computers and the central computer, response time and monitor display are
aster and the users are more productive. Figure 1 - 7 shows a tvpical client /
server environment.
Chapter 1 Introduction to Computers 7

Server

Shared Printers
Central Storage

Clients

FIGURE 1 -7 The Client / Server Environment

Distributed Computing
A distributed computing environment provides a seamless integration of
computing I unctions between different servers and clients. The Internet pro-
vides connectivity to different servers throughout the world . For example ,
eBay uses several computers to provide its auction service. This environment
provides a reliable, scalable, and highly available network. Figure 1 -8 shows a
distributed computing system.

Server

Internet

Server Clients
(browsers)

FIGURE 1 - 8 Distributed Computing

1.3 Computer Languages


To write a program for a computer, we must use a computer language. Over
the years computer languages have evolved from machine languages to natural
languages. A summary of computer languages is seen in Figure 1 - 9 .
8 Section 1.3 Computer longuoges

1940s 1950s

FIGURE 1 - 9 Computer Language Evolution

Machine Languages
only programming languages available
In the earliest days of computers , the
computer has its own machine language ,
were machine languages. Each
1 - 1 shows an example of a
which is made of streams of Os and fs. Program
two numbers and prints the
machine language. This program multiplies
results.

PROGRAM 1 - 1 The Multiplication Program in Machine Language


1 00000000 00000100 0000000000000 000
2 01011110 00001100 11000010 0000000000000010
3 11101111 00010110 0000000000000101
4 11101111 10011110 0000000000001011
5 11111000 10101101 11011111 0000000000010010
6 01100010 11011111 0000000000010101
7 l i i o i n i ooooooio u n i o n oooooooooooiom
8 11110100 10101101 11011111 0000000000011110
9 00000011 10100010 11011111 0000000000100001
10 l i i o i n i ooooooio u n i o n ooooooooooiooio o
11 0 1 1 1 1 1 1 0 1 1 1 1 0 1 0 0 1 0 1 0 1 1 0 1
12 1 1 1 1 1 0 0 0 1 0 1 0 1 1 1 0 1 1 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 1 0 1 0 1 1
13 ooooono IOIOOOIO u n i o n oooooooooonooo i
14 l i i o i n i ooooooio u n i o n oooooooooonoio o
15 01010000 11010100 0000000000111011
16 00000100 0000000000111101

The instructions in machine language must he in streams of O s and I s


because the internal circuits of a computer are made of switches, transistors,
and other electronic devices that can be in one ol two states: off or on . 1 he
off state is represented by 0; the on state is represented by 1 .

The only language understood by computer hardware is


machine language.
Chapter 1 Introduction to Computers 9

Symbolic Languages
It became obvious that few programs would be written if programmers contin-
.
ued to work in machine language In the early 1950s, Admiral Grace I topper, a
mathematician and naval officer, developed the concept of a special computer
program that would convert programs into machine language. I hese early
programming languages simply mirrored the machine languages using
symbols, or mnemonics, to represent the various machine language instructions.
Because they used symbols, these languages were known as symbolic
.
languages Program 1 - 2 shows the multiplication program in a symbolic
language. 2

PROGRAM 1 - 2 The Multiplication Program in Symbolic Language


1 entry main,~ m<r2>
2 subl 2 # 12 ,sp
3 jsb C$MAIN ARGS_
4 movab $CHAR STRING CON
5
6 pushal -8( fp)
7 pushal (r2)
8 calls # 2 ,SCANF
9 pushal -12( fp)
10 pushal 3( r2)
11 calls # 2 ,SCANF
12 mull3 - -
8( fp), 12( fp )
13 pusha 6( r 2 )
14 calls # 2 ,PRINTF
15 clrl rO
16 ret

Because a computer does not understand symbolic language, it must be


translated to the machine language. A special program called an assembler
translates symbolic code into machine language. Because symbolic languages
had to he assembled into machine language, they soon became known as
assembly languages. This name is still used today for symbolic languages
that closely represent the machine language of their computer.

Symbolic language uses symbols, or mnemonics, to represent the various


machine language instructions.

2. The symbolic language format is label , operators, and operands. There are no labels in this example,
so the left column is empty.
10 Section 1.3 Computer Languages

High- Level Languages


Although symbolic languages greatly improved programming efficiency, they
still required programmers to concentrate on the hardware that they were
using. Working with symbolic languages was also very tedious because each
machine instruction had to be individually coded . The desire to improve pro-
grammer efficiency and to change the focus from the computer to the prob-
lem being solved led to the development ol high - level languages .
High - level languages are portable to many different computers, allowing
the programmer to concentrate on the application problem at hand rather
than the intricacies of the computer. High -level languages are designed to
relieve the programmer from the details of the assembly language. High - level
languages share one thing with symbolic languages , however: I hey must be
converted to machine language. The process of converting them is known as
compilation .
I he first widely used high -level language, FORTRAN / was created by
John Backus and an IBM team in 1957; it is still widely used today in scien -
tific and engineering applications. Following soon after FORTRAN was
COBOL.4 Admiral Hopper was again a key figure in the development of the
COBOL business language.
C , with its standard libraries, is considered a high - level language used for
-
system software and new application code. Program 1 3 shows the multipli -
cation program as it would appear in the C language.

PROGRAM 1 - 3 The Multiplication Program in C


1 /* This program reads two integers from the
keyboard
2 and prints their product.
3 Written by:
4 Date:
5 */
6 # include <stdio.h >
7
8 int main ( void )
9 {
10 // Local Definitions
11 int numberl ;
12 int number2;
13 int result;
14
15 // Statements

continued
3. FORTRAN is an acronym for
4. COBOL is an acronym FORmula TRANslation.
for COmmon Business-Ori
rientcd Language.
Chapter 1 Introduction to Computers 11

PROGRAM 1 - 3 The Multiplication Program in C (continued )


16 scanf ( " %d " , & number 1 );
17 scanf ( "%d " , &number2);
18 result = numberl * number2;
19 printf ( " %d " , result );
20 return 0;
21 > // main

1.4 Creating and Running Programs


As we learned in the previous section, computer hardware understands a pro-
gram only it it is coded in its machine language. In this section, we explain
the procedure for turning a program written in C into machine language. The
process is presented in a straightforward, linear fashion, but you should rec -
ognize that these steps are repeated many times during development to cor -
rect errors and make improvements to the code.
It is the job of the programmer to write and test the program. There are
lour steps in this process: ( I ) writing and editing the program, ( 2 ) compiling
the program, ( 3 ) linking the program with the required library modules, and
( 4 ) executing the program . These steps are seen in Figure 1 - 10.

/tv ainclude < stdio.h>


Programmer int main ( void )
Text Editor {

} // main
Source

00110 100
10101 010
Compiler
01001 011
10110 100
is Object

/00110 1001 01010 io\


0011001101001001
Linker

Library h" ' \piooi 0111011010 oj Executable

Loader

Results

FIGURE 1 - 10 Building a C Program


12 Section 1.4 Creating and Running Programs

Writing and Editing Programs

reports, or write programs.


our system , we could use it to write letters create
,

text and program writing is that pro-


The main difference between processing
text processing is clone with
grams are written using lines of code, while most
characters and lines.
, but it is more
Our text editor could be a generalized word processor
often a special editor included with the compiler . Some of the features you
should look for in your editor are search commands to locate and replace
statements, copy and paste commands to copy or move statements
I mm one
part of a program to another, and formatting commands that allow you to set
tabs to align statements.
After we complete a program , we save our file to disk. I his file will be
input to the compiler ; it is known as a source file .

Compiling Programs
The code in a source file stored on the disk must he translated into machine
language . This is the job of the compiler. The C compiler is actually tw o sep -
arate programs: the preprocessor and the translator.
The preprocessor reads the source code and prepares it for the transla -
tor. While preparing the code , it scans for special instructions known as
preprocessor commands. These commands tell the preprocessor to look for
special code libraries, make substitutions in the code, and in other ways pre -
pare the code for translation into machine language . The result of prepro-
cessing is called the translation unit .
After the preprocessor has prepared the code for compilation , the trans-
lator does the actual work of converting the program into machine language.
I he translator reads the translation unit and writes the resulting object
module to a file that can then be combined with other precompiled units to
form the final program . An object module is the code in machine language .
Even though the output of the compiler is machine language
code, it is not
yet ready to run ; that is, it is not yet executable
because it does not have the
required C and other functions included .

Linking Programs
fomTofof theseSeVatT
omc th ’
functions
3
uam maJe UPof °f source> Unctions. However
C P 8
and?they
iS man ’ We write

processes^and m.them..icai
, are a part our program
W L , " ,T that " ."elsewhere
libra
°
functions
" T1' f •

^
exist and
The linker assembles be attached
must our program
to .
all of these functio ns, ours and
final executable program . the system s , into our
Chapter 1 Introduction to Computers 13

Executing Programs
Once our program has been linked , it is ready for execution . To execute a pro-
gram , we use an operating system command , such as run , to load the pro-
gram into primary memory and execute it . Getting the program into memory
is the function of an operating system program known as the loader. It
locates the executable program and reads it into memory. When everything is
loaded , the program takes control and it begins execution . In todays inte -
grated development environments, these steps are combined under one
mouse click or pull-down window.
In a typical program execution , the program reads data lor processing,
either from the user or from a file . After the program processes the data , it
prepares the output. Data output can he to the user ’s monitor or to a file .
When the program has finished its job, it tells the operating system , which
then removes the program from memory.

1.5 System Development


We ’ve now seen the steps that are necessary to build a program . In this sec -
tion , we discuss how we go about developing a program. I his critical process
determines the overall quality and success of our program . II we carefully
design each program using good structured development techniques , our pro-
grams will be efficient , error-free, "* and easy to maintain .

System Development Life Cycle


Today’s large -scale, modern programming projects are built using a series of
interrelated phases commonly referred to as the system development life
cycle . Although the exact number and names of the phases differ depend -
ing on the environment , there is general agreement as to the steps that
must he followed . Whatever the methodology, however, today ’s software
engineering concepts require a rigorous and systematic approach to soft -
ware development .6
One very popular development life cycle is the waterfall model . Depend -
ing on the company and the type of software being developed , this model
consists of between five and seven phases. Figure 1 - 1 I is one possible varia -
tion on the model .


5. Many computer scientists believe that all programs contain at least one hug an undetected error —
that is just waiting to cause problems, given the right set of circumstances. Programs have run for
years without problems only to fail when an unusual situation occurs. Perhaps the most famous bug
was the one known as Y 2 K because it caused programs to fail on January 1.20( H ).
6. For a discussion of various models, see Software Engineering : A Practitioner ' s Approach , 5 th. ed . by
Roger S . Pressman , ( New York . NY: McGraw- Hill , 2001 ).
/

14 Section 1.5 System Development

Systems
Requirements
Analysis

Design

Maintenance

FIGURE 1 - 11 Waterfall Model

The waterfall model starts with systems requirements . In this phase, the
systems analyst defines requirements that specif ) what the proposed system
is to accomplish. The requirements are usually stated in terms that the user
understands. The analysis phase looks at different alternatives from a system ’s
point of view, while the design phase determines how the system will be built .
In the design phase, the functions of the individual programs that will make
up the system are determined and the design of the liles and/or the databases
is completed . Finally, in the fourth phase, code , we write the programs. This
is the phase that is explained in this book. After the programs have been writ -
ten and tested to the programmer’s satisfaction , the project proceeds to sys -
tem test . All of the programs arc tested together to make sure the system
works as a whole . The final phase, maintenance , keeps the system working
once it has been put into production .
Although the implication of the waterfall approach is that the phases
( low in a continuous stream from the first
to the last, this is not really the
case. Note the iteration as indicated by the backward - flowing arrows in
Figure 1 - 1 1 . As each phase is developed , errors and omissions will often be
found in the previous work. When this happens, it is necessary to go back to
the previous phase to rework it lor consistency and to analyze the
impact
caused hv the changes. Hopefully, this is a short rework. We are aware of at
least three major projects, however, that were in the code
and test phases
when it was determined that they could not be implemented
and had to be
canceled. When this happens, millions of dollars and years
of development
are lost .

Program Development
Program Development is a multistep process
stand the problem , develop a solution , that requires that we under-
write the program , and then test it.
Chapter 1 Introduction to Computers 15

When we are given the assignment to develop a program, we will be given a


program requirements statement and the design of any program interfaces .
We should also receive an overview of the complete project so that we will
.
understand how our part fits in to the whole Our job is to determine how to
take the inputs we are given and convert them into the outputs that have
been specified. This is known as program design . To give us an idea of how
this process works, let s look at a simple problem: Calculate the square foot -
age of a house. I low do we go about doing this ?

Understand the Problem


The first step in solving any problem is to understand it. We begin by reading
the requirements statement carefully. When we think that we fully under -
stand it , we review our understanding with the user and the systems analyst.
Often this involves asking questions to confirm our understanding.
For example, after reading our simple requirements statement, we should
ask several clarifying questions.

What is the definition of square footage?


How is the square footage going to be used?
for insurance purposes?
to paint the inside or outside of the house?
to carpet the whole house?

Is the garage included?


Are closets and hallways included?

Each of these potential uses requires a different measure. II we don’t


clarify the exact purpose— that is, if we make assumptions about how the out -
put is going to be used—we could supply the wrong answer.
As this example shows, even the simplest problem statements need clarifi -
cation. Imagine how many questions must be asked for a programmer to write
a program that will contain hundreds or thousands of detailed statements.

Develop the Solution


Once we fully understand the problem and have clarified any questions we
.
may have, we need to develop our solution Three tools will help us in this
task: ( 1 ) structure charts, ( 2 ) pseudocode, and ( 3) flowcharts. Generally, we
will use only two of them—a structure chart and either pseudocode or a
flowchart.
The structure chart is used to design the whole program. Pseudocode
and flowcharts, on the other hand, are used to design the individual parts of
the program. These parts are known as modules in pseudocode or functions
in the C language.
16 Section 1.5 System Development

Structure Chart the functional


as a hierarchy chart , shows
A structure chart, also known structures consisting
flow through our program . Large
programs arc complex . I his task is
they must he carefully laid out
of many interrelated parts ; thus,
design engineer who is responsible lor the operational
similar to that of a
difference between the design built by
design of any complex item . The major programmers
a programmer and the design
built by an engineer is that the
the computer , whereas the engi -
product is software that exists only inside and touched .
neer’s product is something that can
be seen
going to break our program into
The structure chart shows how we are
logical steps; each step will he a separate module
. The structure chart shows
) of our program .
the interaction between all the parts ( modules
It is important to realize that the design
, as represented by the structure
. In this respect , it is like the archi-
chart, is done before we write our program
to build a house without a detailed set of
tect ’s blueprint . We would not start
and new pro-
plans. Yet one of the most common errors of both experienced
design is complete and
grammers alike is to start coding a program before the
fully documented . fully
This rush to start is due in part to programmers thinking they

understand the problem and also due to their excitement about solving new
a
problem . In the first case , what they find is that they did not fully understand
the problem. By taking the time to design the program , they will raise more
questions that must be answered and therefore will gain a better understand -
ing ol the problem .

An old programming proverb: Restet the temptation to code .


The second reason programmers code before completing the design is
just human nature. Programming is a tremendously exciting task , lo see our
design begin to take shape, to see our program creation working lor the lirst
time , brings a form of personal satisfaction that is a natural high .
In the business world , when we complete a structure chart design , we
-
will convene a review panel for a structured walk through of our program .
Such a panel usually consists of a representative from the user community,
one or two peer programmers, the systems analyst , and possibly a representa
live from the testing organization. In the review, we will walk our review team
through our structure chart to show how we plan to solve the objectives of
our program. The team will then offer constructive suggestions as to how to
improve our design.
The primary intent of the review is to increase quality and save time. The
earlier a mistake is detected , the easier it is to fix it . If we can
one or two problems with the structured walk- through ,
eliminate only
the time will he well
spent. Naturally, in a programming class, you will not
be able to convene a
lull panel and conduct a formal walk- through .
What you can do, how'ever, is
review your design with some of your classmates
and with your professor.
1
Chapter 1 Introduction to Computers 17

Looking again at our problem to calculate the square footage of a house,


let ’s assume the following answers to the questions raised in the previous
section.

.
1 The purpose of calculating the square footage is to install new floor cov-
ering.
. .
2 Only the living space will be carpeted The garage and closets will not he
considered.
.
3 The kitchen and bathrooms will he covered with linoleum; the rest ol the
house is to he carpeted.
With this understanding, we decide to write separate modules lor the
kitchen, bathroom( s), bedrooms, family room, and living room. We use sepa -
rate modules because the various rooms may require a dilferent quality ol lino-
leum and carpeting. The structure chart for our design is shown in Figure 1 - 12.

flooring
Cost

get print
calculate Report
Userlnfo

calc calc
Linoleum Carpeting

calc calc calc calc


Kitchen BathRooms BedRooms LivingAreas

calc calc
FamilyRoom DineLiving

FIGURE 1 - 1 2 Structure Chart for Calculating Square Footage

W hether you use a flowchart or pseudocode to complete the design ol


your program will depend on your experience, the difficulty ol the process you
are designing, and the culture and standards of the organization where you
.
are working We believe that new programmers should first learn program
design by flowcharting because a flowchart is a visual tool that is easier to
.
create than pseudocode On the other hand, pseudocode is more common
among professional programmers.
Random documents with unrelated
content Scribd suggests to you:
Ortega (Lúcas Fernandez), Vida de la Madre María Magdalena,
religiosa del Monasterio de San Gerónimo de Mex. MS. [1636.]
4to.
Ortega (Manuel del C.), El Trono de Mexico 1864. Mexico, 1864.
Ortega y San Antonio (Joseph Joachin), Nueva Aljaba apostólica
con varias canciones. Mexico, 1757.
Ortiz (Tadeo), Mexico considerado como nacion independiente.
Burdeos, 1832.
Ortiz de Ayala (Tadeo), Resúmen de la Estadística del Imperio
Mexicano. Mexico, 1822.
Osborne (John), Guide to the West Indies, Madeira, Mexico, etc.
London, 1845.
Ossorio (Diego), Americano seráphico llanto de esta provincia del
Santo Evangelio. Mexico, 1737. 4to.
Ossuna (Joachin), Peregrinacion christiana por el camino real.
Mexico, 1756.
Oswald (Felix L.), Summerland sketches. Philadelphia, 1880.
Otero (Mariano), Comunicacion sobre las negociaciones entre
Estados-Unidos y Mexico. Mexico, 1847.
Otero (Mariano), Ensayo sobre el verdadero estado de la cuestion
social y política, Mexico, 1842. Mex., 1842.
Otero (Mariano), Obras. MS. 1859-60. 7 vols.
Otero (Mariano), Oracion cívica el dia 16 de Setiembre de 1843.
Mexico, 1843.
Oviedo (Juan Antonio de), Vida admirable, apostólicos ministerios
y heróicas virtudes. Mexico, 1752. 4to.
Oviedo y Valdés (Gonzalo Fernandez de), De la Natural Hystoria
de las Indias. Toledo, 1526.
Oviedo y Valdés (Gonzalo Fernandez de), Historia General y
Natural de las Indias. Madrid, 1851-5. 4 vols. 4to.
Oviedo y Valdés (Gonzalo Fernandez de) Sommario. In Ramusio,
Viaggi. tom. iii.
Oviedo Herrera y Rueda (Luis Antonio de), Poema sacro de la
pasion de Jesu Cristo. Mexico, 1780. 4to.
Owen (Tom), Anecdotes and Letters of Zachary Taylor. New York,
1848.
Pabellon Nacional. Mexico, 1844 et seq.
Pacheco (Joaquin F.) and Cárdenas et al., Coleccion de
Documentos Inéditos relativos al Descubrimiento, Conquista y
Colonizacion de las Posesiones Españolas en America. Madrid,
1864-81. 34 vols.
Pacheco (José Ramon), Cuestion de Mexico. Mexico, 1863;
Descripcion de la solemnidad fúnebre etc. de Iturbide. Mex.,
1849; Exposicion del exministro de relaciones. Querétaro, 1847;
Guerra de España con Mejico. Paris, 1856; Lettres sur le
Mexique. Bordeaux, 1833.
Pacto Social sobre Leyes, Jueces y Abogados, contra el nuevo.
[Mexico, 1822.]
Palacio (Mariano Riva), and Rafael Martinez de la Torre,
Memorandum sobre el Proceso del Maximiliano. Mexico, 1867.
Palacio (Vicente Riva), Soberanía de los Estados y la Suprema
Corte de Justicia. Mexico, 1874.
Palafox y Mendoza (Juan), Obras. Madrid, 1762. folio. 15 vols.
[Most of which works also exist in separate form.]
Palanca (La). Guadalajara, 1826 et seq.
Panes (Diego García), Extension interesante de la Plaza de Vera
Cruz. MS. 1800.
Panes y Abellan (Diego), Cronología de los Vi-reyes de Nueva
España. MS.
Papalotla, Instalacion de su Ayuntamiento. MS.
Papel de Estrasa en que se filtra el Baratillo y se cuela de Nulgo.
MS. 1753.
Papeles en Derecho. A Collection.
Papeles de Jesuitas. A Collection. MS. folio.
Papeles Franciscanos. A Collection. MS. folio. 2 vols.
Papeles Sueltos. A Collection.
Papeles Varios. A Collection of Spanish and Mexican Pamphlets.
218 vols.
Parada (Vicente Gomez), Segunda esposicion que hace al
Soberano Congreso. Mexico, 1841.
Pardo (Diego), Métrica exposicion de la regla seráfica, etc. MS.
1650.
Parecer de los Señores Theólogos de. Salamanca, 1541.
Paredes (Antonio de), Carta edificante. Mexico, 1791; Carta
edificante, extinguida Compañía de Jesvs. Mexico, 1784; Voto
Particular, en la Junta de Minería de 16 de Marzo. Mexico,
1868.
Paredes (Mariano), Breve Esposicion que el General hace. Mex.,
1847.
Paredes y Arrillaga (Mariano), Breve esposicion que hace á sus
conciudadanos. Mex., 1847; Contestaciones que á la circular. S.
L. Potosí, 1845; Esposicion que á sus conciudadanos. Mex.,
1841; Manifiesto de la República Mexicana. Mex., 1846.
Parescer ó Determinacion de los señores theólogos de
Salamanca. Londres, 1854. 4to.
Parian (El), Coleccion de documentos oficiales relativos á la
construccion, etc., del. Mex., 1843; Esposicion á la Cámara por
Demolicion de. Mex., 1844; Primera representacion del
Comercio solicitando una indemnizacion. Mex., 1849.
Parker (Theodore), A Sermon on the Mexican War. June 25, 1848.
Boston, 1848.
Parkman (P.), Informe que dió el perito facultativo, minas del
mineral del Gallo. Mexico, 1848. 4to.
Parra (Francisco), Conquista de la provincia de Xalisco, Nuevo
Reyno de Galicia, etc. MS. [1805] 4to.
Parra (Joseph Gomez), Importantíssimas y verdaderas
resoluciones para Eclesiásticos. Puebla, 1712.
Parres (Luis), Manifestacion del Contador de la Aduana Marítima
de Matamoros. Matamoros, 1839.
Parrodi (A.), Memoria sobre la Evacuacion militar del puerto de
Tampico. Tamaulipas, 1846.
Parthe (Ernst), Die Intervention in Mexico. Leipzig and Stuttgart,
1864.
Pasatiempo (El), Coleccion de Novelas, Anécdotas, etc. Mejico,
1839.
Pastoral en dos Actos. MS. 1828.
Patino (Pedro Pablo), Disertacion crítico theo-filosófica sobre la
conservacion de la Santa imágen. Mexico, 1801. 4to.
Patronato analizado contra el Patronato embrollado. Mejico, 1833.
Patronato, Diálogo entre un cura y un Abogado. Mexico, 1827.
Patronato, Opusculos sobre. A Collection.
Patterson (Geo. W.), Across Mexico to California. MS.
Pattronatto de Partte (1726 hasta 1742). MS.
Pauw (Corneille), Recherches philosophiques sur les Américains.
Londres, etc., 1770. 3 vols.
Payno, Cronología de Mexico. In Soc. Mex. Geog., Boletin, tom.
vi.
Payno (Manuel), Compendio de la Historia de Mexico. Mexico,
1870; Cuadro sinóptico de la Historia Antigua de Mexico. Mex.,
1867; Cuentas, Gastos Acreedores y otros asuntos. Mex., 1868;
La Convencion Española. Mex., 1857; La Deuda Interior de
Mex. Mex., 1865; Memoria sobre el Maguey Mex. Mex., 1864;
Memoria sobre la Revolucion de Dic. de 1857 y Enero de 1858.
Mex., 1860; Mexico and her Financial Questions with England.
Mex., 1862; Proyectos de arreglo de los gastos de la Hacienda.
Mex., 1848.
Paz (La). Mexico, 1858 et seq.
Paz (José Ignacio), Plan de estatutos, constituciones y ejercicios.
Mexico, 1819.
Pearce, Speech on Ten Regiment Bill. Jan. 13, 1848. Washington,
1848.
Pearce, Speech on Three Million Bill. March 1, 1847. Washington,
1847.
Pedraza (Manuel Gomez), Acusacion presentada en la cámara de
diputados, 2 Dic. 1830. Mex. 1830; Impugnacion á la
contestacion del. Mex., 1827; Manifiesto (Jul. 30, 1823). (Mex.,
1823); Notas al manifiesto Publicado. Mex., 1831; Reflexiones
importantes al Mensage de Pedraza. Mex., 1833.
Pedroza (F. de J.), Biografías de los principales Caudillos de la
Independencia. La Paz, 1878; Compendio Histórico de la
Conquista de Mexico. La Paz, 1877.
Pelletan (Eugenio), Profession de fé del Siglo Diez Y Nueve.
Mexico, 1861.
Peña (Ignacio de la), Trono Mexicano en el Convento de
religiosas pobres capuchinas. Madrid, 1728. 4to.
Peña (Luis de la), La Muerte Temprana pero Madura. Mexico,
1725.
Peña y Peña (Manuel de la), Coleccion de los documentos mas
importantes relativos á la instalacion y Reconocimiento. Mex.,
1847; Discursos presentados á la Academia de Jurisprudencia.
Mex. 1850; Lecciones de Práctica Forense Mejicana. Mex.,
1835-9. 4 vols; Revoquese esta sancion por el bien de la
Nacion. Mex., 1841. folio; Voto fundado por, en la causa contra
Alaman. Mex., 1835.
Peña y Peña (Manuel de la), Comunicacion Circular sobre la
Cuestion de Paz ó Guerra. Querétaro, 1848.
Pensamiento Nacional (El). Mexico, 1855 et seq.
Penuelas (Pablo), Sermon que en accion de gracias por la
exaltacion al trono. Mexico, 1791.
Penuelas (Pablo Antonio), Breve noticia de la prodigiosa imágen
de Nuestra Señora de Los Angeles. Mexico, 1781.
Peralta (Antonio de), Disertaciones scholasticæ de Divinis
Decretis. Mexico, 1727.
Peralta (Juan Suarez de), Noticias Históricas de la Nueva España.
Madrid, 1878. folio.
Peraza (Juan), Proceso contra negro esclauo de Guillen Peraza.
MS., 1599.
Peredo (Vicente del), Historia de la Santísima Vírgen María.
Mexico, 1823.
Perez, Proclama del Capitan General. Mexico, 1809.
Perez (Antonio Joaquin), Oracion fúnebre, Salvador Biempica y
Sotomayor. Madrid, 1804.
Perez y Camoto (Florencio), Representacion que á favor del libre
comercio, etc. Habana, 1818. 4to.
Perez (Gio.), and Gio. Battista Zappa, see Relatione Della
Missione, etc.
Perico (El). Mexico, 1862 et seq.
Periódicos Miscelaneos. A Collection.
Periódicos Varios. A Collection.
Perry (J. A.), Travels, Scenes, and Sufferings in Cuba, Mexico,
etc. Boston, 1853.
Pésame á los Mexicanos por la muerte de la Patria. Ó Sea
oposicion á la ley sobre cobre, Tabaco y Tejas. Mexico, 1841.
Pésame de Pésames y Respecto de respectos. MS.
Peterson (Charles J.), The Military Heroes of the War of 1812 and
of the war with Mexico. Philadelphia, 1858.
Peypus (Frederick), Ein auszug ettlicher sendbrieff dem aller
durchleüchtigisten. Nuremburg, 1520.
Phelps, Speech in U. S. Senate, Jan. 27, 1848. Washington, 1848.
Phillips (John), Mexico Illustrated. London, 1848. folio.
Pierard (A.), Souvenirs du Mexique. Bruxelles, 1867.
Pierron (Eduardo), Datos para la Geografía del Imperio Mexicano.
Mexico, 1866. 4to.
Pieschel (Carl), Die Vulkane der Republik Mexiko. Berlin, 1856.
folio.
Pillow, Defence of, before court of inquiry, n.pl. [1848.]
Pimentel (Francisco), Cuadro descriptivo y comparativo de las
lenguas indígenas de Mexico. Mex., 1862. 2 vols.; Disertacion
leida en la Sociedad Mexicana de Historia Natural. Mex., 1869;
La Economía Política. Mex., 1866; Memoria sobre las Causas
que han originado la situacion actual de la raza indígena de
Mex. Mexico, 1864.
Piña y Cuevas (Manuel), Esposicion al Tribunal Superior del
Distrito Federal. Mexico, 1861.
Pinal (L.), Catecismo de economía política. Mexico, 1856.
Pinart (Alphonse), Coleccion de documentos originales para la
historia de Mexico. MS.
Pineda (Emeterio), Descripcion Geográfica del departmento de
Chiapas y Soconusco. Mexico, 1845.
Piquero (Ignacio), Breve Instruccion sobre las Contribuciones.
Mexico, 1845.
Pius V., Bulla Confirmationis. 1568.
Pizarro (Nicolás), Catecismo político constitucional. Mejico, 1867.
Pizarro y Orellana (Fernando), Varones Ilvstres del Nvevo Mvndo.
Madrid, 1639. folio.
Plan de Hacienda para la República Mexicana. Mexico, 1847.
Plancarte (Joseph), Sermon de gracias que en la exaltacion al
trono. Mexico, 1791.
Platería, Ordenanzas del nobilíssimo arte. Mexico, 1715. folio.
Plausible gozo de la N. España por la prision de crueles
insurgentes. [Mexico] n.d. 4to.
Plaza de Mexico, Balanza Mercantil, 1843-5. Mexico, 1844-6.
folio.
Pleitos. A Collection. 6 vols.
Poblanos (Los), á los habitantes de Mejico. Puebla, 1821. folio.
Pobre Peregrino (El). Vera Cruz, 1844. folio.
Poesías Mexicanas 1700-1860. A Collection. 2 vols.
Poinsett (J. R.), Contestacion del Ministro Americano. Mex., 1829;
Esposicion de la conducta política de los Estados-Unidos. Mex.,
1827; Manifiesto de los principios políticos. Mex., 1828; Notes
on Mexico. London, 1825.
Polichinelle (Platon), El Arca del Pueblo. Mexico, 1858. 2 vols.
Política de los españoles en la conquista y colonizacion de
América. Madrid, 1882.
Polk (J. K.), Mensage del Presidente de los Estados-Unidos.
Mexico, 1848.
Ponmarede (J. A.), Nouveau moyen de prévenir les Inondations
de la Ville et la Vallée de Mex. Mexico, 1860.
Poore (Ben Perley), Life of Gen. Zachary Taylor. Boston, n.d.
Portegueda (Juan Ventura de), Sentimientos sublimes de religion.
Mexico, 1811.
Porter (Charles T.), Review of the Mexican War. Auburn, 1849.
Portfolio (The). Philadelphia, 1817.
Portilla (Anselmo de la), España en Mexico. Mexico, 1871; Mejico
en 1856 y 1857. New York, 1858.
Portilla (J. de la), Episodio Histórico del gob. Dictatorial en la
República Mexicana. Mexico, 1861.
Portilla (Jesus Lopez), Esposicion que dirige al Público el
Gobernador de Jalisco. Mexico, 1853, 4to.
Portilla (Pedro de la), Representacion que el ciudadano hace al
soberano Congreso, 1826. Mexico, 1826.
Portugal (Juan Cayetano). [Pastoral letter 22 de Feb. 1850.] MS.
[Morelia, 1850.]
Posadas (Manuel), Alegato de defensa. Mexico, 1830.
Potestad Pontificia. Madrid, 1826.
Poussin (Guillaume Tell), De la Puissance Américaine, etc. Paris,
1848. 2 vols.
Powell (C. Frank), Life of Maj.-Gen. Zachary Taylor. New York,
1846.
Pradt (Dufour de), The Colonies and the Present American
Revolutions. London, 1817.
Presas (José), Juicio Imparcial sobre las principales causas de la
revolucion de la América Española. Burdeos, 1828.
Presas (Josef de), Memoria sobre el estado y situacion política en
que se hallaba el reyno de Nueva-España en Agosto de 1823.
Madrid, 1824. 4to.
Prescott (William H.), Historia de la Conquista de Mexico. Mexico,
1844-6. 3 vols.; also Mexico, 1845-6, 3 vols.; also Madrid, 1847-
50, 4 vols.
Prescott (William H.), Historia de la Conquista del Perú. Mexico,
1850. 2 vols.
Prescott (William H.), Historia del Reinado de los Reyes Católicos
D. Fernando y Isabel. Mexico, 1854. 2 vols.
Prescott (William H.), History of the Conquest of Mexico. New
York, 1844. 3 vols.; also Philadelphia, 1860. 3 vols.
Préstamos, Contribuciones y Exacciones de la Iglesia de
Guadalajara. Guadalajara, 1847.
Prieto (Guillermo), Algunas ideas sobre organizacion de la
Hacienda. Mex., 1861; Indicaciones sobre el orígen, etc., de las
Rentas Generales de la Fed. Mex. Mex., 1850; Lecciones
Elementales de Economía Política. Mex., 1871; Viaje á los
Estados Unidos 1877. Mex., 1877-9. 3 vols.; Viages de Orden
Supremo. Mex., 1857.
Prim (General), Discurso en el Senado Español, Cuestion Mex.
Mexico, 1862. 4to; Speech upon the Mexican question in the
Senate of Spain. San Francisco, 1863.
Primer gefe del Ejército imperial á los habitantes de Mexico.
Mexico, 1821. folio.
Proceso por el Real Audiencia de la Española. In Icazbalceta, Col.
Doc., tom. i.
Proceso sobre la fuga de siete religiosos del Convento de la
Merced. MS. Mexico, 1800.
Proclama de una Americana á sus compatricias. [Mexico, 1810.]
Proclama del Arzobispo Virey contra los engaños pérfidos de los
Bonapartes. [Mexico, 1810.]
Proclama que dirige á los españoles Europeos. Mexico, 1810.
Prontuario por materias y órden alfabético. Mexico, 1828.
Prospectus and Act Incorporating the American and Mexican
Railroad and Telegraph Company. New York, 1869.
Protesta del Illmo Señor Arzobispo de Cesarea y vicario Capitular.
Mexico, 1848.
Providencias sobre Azogues, 1670-73. MS.
Provincia de San Diego de Mexico, Alternativa que se ha
observado. MS. 1772.
Provincia de San Nicolás, (Por la).... De la Orden de San Augustin
en el Pleyto con el Padre presentado Fray, n.pl., n.d.
Provincia del Santo Evangelio de Nueva España. [A collection of
MSS. of the 16th century.] folio.
Provincial del Cármen, Esposicion que por las exenciones de la
Provincia de Mexico, 1851.
Provincias Internas, Copia de una carta del Ministro de Guerra de
España de 24 de Julio, 1812. MS.
Provincias Internas, Real Orden de 11 de Marzo de 1788
concediendo al virey de N. España. MS.
Provincias Internas, Real Orden de la Regencia de 12 de Julio,
1812. MS.
Provision de Obispados, Cuestion relativa á la. Mexico, 1850.
Proyecto de Comunicacion Oceánica por el Centro de la
República. Vera Cruz, 1851.
Proyecto de un Ferrocarril y Telégrafo desde la Línea Division de
Mexico y los Estados-Unidos. Mexico, 1868.
Proyecto para Galeones y Flotas del Peru y Nueva-España.
Madrid, 1720. folio.
Proyecto sobre un establecimento de Papel Moneda. Mexico,
1822.
Puebla, Arancel de los honorarios y derechos judiciales. Puebla,
1841; Mex., 1840; El Ayuntamiento de Puebla á los habitantes
de su comarca. [Mex., 1821.] folio; Breve Descripcion de los
festivos. n.pl. [1767] 4to; Contestacion dada por el Sr. Obispo de
Puebla. Mex., 1847; Contestacion dirigida al exmo Sr. Gob.
Puebla, 1851. 4to; Contestacion al Manifiesto que seis
individuos del Ayunto de Puebla. Puebla, 1840. 4to; Coleccion
de Acuerdos y Decretos. Puebla, 1832. 4to; Coleccion de los
Decretos, etc., del 1o Cong. Constitucional en 1826-8. Puebla,
1828. folio; Constitucion Política del Estado Libre de Puebla.
Puebla, 1825; Puebla, 1848; Puebla, 1861; Corona Cívica á los
héroes del 2 de Abril de 1867. Mérida, 1868; Decreto de 28 de
Setiembre de 1861. n.pl., n.d.; El C. Francisco Ibarra
gobernador interino á sus habitantes, sabed. [Puebla, 1865];
Iniciativa que para impedir la importacion de hilaza estrangera y
demas efectos Prohibidos. [Puebla, 1841.] 4to; De la Junta de
industria de Puebla. n.pl., 1846. 4to; Libertad de Puebla.
[Mexico, 1828]; Manifiesto que el Batallon. Puebla, 1830;
Manifiesto del Señor Obispo con otros documentos para
desengaño de los incautos. Mexico, 1812; Manifiesto que hacen
al público el Alcalde, Regidores y Síndico. Puebla, 1840;
Memoria presentada al Congreso de Puebla de los Angeles por
el Secretario del Despacho de Gobo sobre el estado de la
Admin. púba, año de 1827. Mex., 1827. 4to; Memoria
presentada al Congreso de Puebla de Los Angeles por el
Secretario del despacho de Gobo sobre el estado de la Admin.
púba, año de 1830. Mex. [1830] 4to; Noticias Sagradas que á
mayor honra y gloria de Dios. Puebla, n.d. 4to; Nuevos Medios
para una Comunicacion Inter-Oceánica. Puebla, 1851;
Ofrecimiento de los Señores Eclesiásticos de la Ciudad de
Puebla. Mex., 1821; Ordenanzas para el nuevo estab. de
Alcaldes de Quartel. Puebla, 1796. folio; Parte Gen. que sobre
la campaña de Puebla. Mex., 1856. Proclama Oct. 24, 1846.
[Puebla, 1846.] folio; Reflexiones sobre varios Artículos del
Proyecto de Constitucion. Puebla, 1823; Refutacion á la
Contestacion. Puebla, 1840; Representacion del Exmo
Ayuntamiento de la capital de Puebla. Puebla, 1836. 4to;
Representacion que la exma junta Departamental de Puebla.
[Puebla, 1841.] 4to; Representacion que la junta disectiva de
industria. Puebla, 1851. 4to; Representacion de la Junta de
industria. n.p. 1846. 4to; Representacion que la junta de
industria de Puebla eleva al honorable congreso. Puebla, 1850.
4to.
Puebla de los Angeles, Noticias sagradas que á mayor honra.
Puebla, 1691.
Puebla de Zaragoza, Sitio de. Mexico, 1863.
Pueblo Mexicano, Relacion de las causas que influyeron en los
degraciados sucesos del dia 20 de Agosto de 1847. Mex., 1847.
Puente Escala aereo, Ligera descripcion. [Mexico, 1841.]
Puente (Pedro de la), Reflexiones sobre el Bando de 25 de Junio
Último. Mexico, 1812. 4to.
Puerta (Juan de la), Carta al Emperador. In Cartas de Indias.
Puerte et al., Carta al Consejo de las Indias. In Cartas de Indias.
Puertocarrero, Testimonio de, in Col. Doc. Inéd., tom. i.
Puga (Vasco de), [Cedulario] Provisiones, Cédulas, Instrumentos
de su Magestad. Mexico, 1563.
Puigblanch (Antonio), La inquisicion sin máscara, ó disertacion.
Mexico, 1824.
Pulque Blanco, Ordenanças de los Señores Virreyes. [Mexico,
1653.] folio.
Purchas, His Pilgrimes. London, 1625-6. 5 vols, folio.
Purdy (John), Whittle and Laurie’s complete Sailing Directions.
London, 1819.
Pusalgas (Ignacio), El Nigromántico Mejicano. Barcelona, 1838. 2
vols.
Quarterly Review. London, 1809 et seq.
Que Muera el Papel Moneda ya que Comenzó á Enfermar.
[Mexico, 1823.]
Queipo (Manuel Abad), Carta pastoral del ilustrísimo Señor
Obispo electo y Gobernador. Mexico, 1813; Coleccion de los
escritos mas importantes que dirigió al Gobierno. Mex., 1813;
Edicto instructivo. [Sept. 30, 1810. Mex., 1810.]
Quejas de los Mexicanos á su Ilustre Presidente. Mexico, 1841.
Querétaro, Caida de ... en 1867. Mex., 1868; Constitucion Política
del Estado el 12 de Agosto de 1825. Mex., 1833; Dictámen que
la Junta departamental. Querétaro, 1840; Dos Palabras en
Honor de. Quer., 1842; El Congreso de Querétaro á sus
Comitantes. Mex., 1849; El Cura de Santiago de, á sus fieles
habitantes. n.pl., n.d.; Espediente formado sobre la suspension
que decretó el Supremo Gobierno. Quer., 1844; Estadística del
Departamento. Quer., 1846; Iniciativa que la Honorable
Legislatura. Quer., 1848; Querétaro Libre. Mex., 1830; Notas
estadísticas. Mex., 1848; Ocurrencias en los dias 18 y 19 de
Enero de 1847. Quer., 1847; Ordenanza que para la Division de
la ciudad de Santiago. Mex., 1796; Relacion Histórica que hace
la Exma Asamblea. Quer., 1845.
Quijar (Gerónimo), Alegato de Buena Prueba presentado por el.
Durango, 1871.
Quijotita (La), y su prima. Mexico, 1831-2. 4 vols.
Quinet (Edgar), La Espedicion de Mexico. Mexico, 1863.
Quiñones (José García), Descripcion de las demostraciones.
Puebla, 1809.
Quintana Roo (Andrés), Acusacion presentada en la Cámara de
Diputados el 2 de Dic. de 1830. Mex. 1830; Amplicacion que el.
Mex., 1832; Cuarta representacion á la Cám de Dip. Mex.,
1831; Discurso en la Alameda el 16 de Sept. de 1845. Mex.,
1845; Informe del Apoderado de los Acreedores, etc. Mex.,
1834; Observaciones sobre un informe que dió. Mex., 1835.
Quiroga, Carta. In Pacheco and Cárdenas, Col. Doc., tom. xiii.
Quiroga (Domingo), Compendio breve de la Vida, etc. Mexico,
1729.
Quiros (José María), Memoria de Estatuto. Vera Paz, 1817; Voz
imperiosa de la Verdad. Mex., 1810.
Quixano (Dr), Discurso sobre la Insurreccion de América. Mexico,
1814; Guadalaxara, 1814.
Ramirez (Antonio de Guadalupe), Breve Compendio de todo lo
que debe saber y entender. Mexico, 1785.
Ramirez (José Fernando), Acusacion presentada al Gran Jurado.
Mejico, n.d.; Apuntes para escribir la Historia del valor y orígen
de las Monedas que corrian en Mexico en el siglo de su
conquista. MS. folio; Apuntes para servir á la historia de las
Convenciones Diplomáticas. Mex., 1852; Documentos relativos
á la fundacion del Hospital del Amor de Dios. MS.; Informe que
hizo en defensa de Bonilla. Mex., 1861; Memorias,
Negociaciones y Documentos para servir á la Historia entre
Mexico y los Estados-Unidos [cuestion Tehuantepec]. Mex.,
1853; Noticias Históricas y Estadísticas de Durango. Mex.,
1851; Observaciones hechas al documento no 4 de la memoria.
Mej., 1852; Proceso de Residencia contra Pedro de Alvarado.
Mex., 1847; Vida de Motolinia. In Icazbalceta, Col. Doc., tom. i.
Ramirez (José Miguel), Voto Particular al proyecto de reformas de
las leyes constitucionales. [Mex., 1840]; Voto Particular que
sobre el punto de Patronato presentó al Sob. Cong. Mex., 1824.
Ramirez (Josephus), Via lactea seu vita candidissima S. Philippi
Nerii. Mexico, 1698.
Ramirez Ponce de Leon (Juan Felix), Testimonio del Testamento
Memoria y dos Cobdicillos. MS., 1714. folio.
Ramirez de Prado (Marcos) and J. de O. Montañez, Coleccion de
las Ordenanzas que para el Gobierno de el Obispado de
Michoacan. Mexico, 1776.
Ramirez y Sesma (Joaquin), Coleccion de Decretos para el
Ejército. Mexico, 1827.
Ramon (Domingo), Derrotero para las misiones de los presidios
internos. In Mayer MSS.
Ramos (Alonso), Lvz de Verdades Cathólicas. Mex., 1691;
Primera Parte de los Prodigios de la Omnipotencia. Puebla,
1689.
Ramsey (Albert C.), The Other Side. New York, 1850.
Ramusio (Giovanni Battista), Navigationi et Viaggi. Venetia. tom.
i., 1554; tom. ii., 1583; tom. iii., 1565. 3 vols, folio.
Rangel (Joaquin), Defensa que el Señor General Tomás Requena
hizo. Mex., 1845; Esposicion hecha por los individuos de la
estinguida Corte Marcial, etc. Mex., 1845; Segunda defensa del
Sr. Gen. Requena. Mex., 1845; Tercera Brigada del Ejército
Mexicano. Mex., 1847.
Rankin (Melinda), Twenty Years among the Mexicans. Cincinnati,
1881.
Ranking (John), Historical researches on the Conquest of Peru.
Mexico, etc. London, 1827.
Raso. In Soc. Mex. Geog., Boletin, tom. iii.
Ratos Entretenidos ó Miscelanea útil y curiosa. Mexico, 1819. 2
vols.
Ratzel (Friedrich), Aus Mexico: Reiseskizzen, 1874 und 1875.
Breslau, 1878.
Ravignan (X.), De los Jesuitas y de su Instituto. Mexico, 1845.
Rawson (William), The present operations and future prospects of
the Mexican Mine Associations. London, 1825.
Raymond, Del Catolicismo en las sociedades. Mexico, 1851.
Rayon, Asedio y Defensa de Mexico ó sucesos del 13 de Agosto
al 15 de Setiembre de 1847. Mexico, 1847. MS.
Razon (La). Mexico, 1857 et seq.
Razonador (El). Mexico, 1847 et seq.
Reales Cédulas, Ordenes y Decretos. In Col. Doc. Inéditos;
Navarrete, Col. de Viages; Ordenes de la Corona; Pacheco and
Cárdenas, Col. Doc.
Real Declaracion de 17 Junio 1773 sobre Monte Pio militar.
Madrid, 1773. folio.
Real Executoria. In Pacheco and Cárdenas, Col. Doc., tom. xii.
Reavis (L. U.), The New Republic. St. Louis, 1867.
Recopilacion de las Leyes del Gobierno Español que Rigen en la
República. Mexico, 1851.
Recopilacion de Leyes de Los Reynos mandadas Imprimir y
Publicar por Cárlos II. Madrid, 1791. folio. 4 vols.
Reflecciones sobre el Dictámen de las Comisiones Eclesiástica y
de relaciones acerca de enviado á Roma. Mexico, 1826.
Reflecsiones sobre algunas reformas á la Constitucion Federal de
la República Mexicana. Mexico, 1835.
Reflexiones Confidenciales ó sea Carta á un Amigo sobre el
Opúsculo. Mexico, 1865.
Reflexiones sobre la ley que declara irredimibles los capitales
pertenecientes á corporaciones y obras pias. Mexico, 1847.
Refutacion de un español-Americano á proclamas de José
Bonaparte. Mexico. 1810.
Refutacion en la parte histórica del artículo de fondo. Mexico,
1849.
Registro Trimestre. Mexico, 1832-3. 2 vols.
Registro Yucateco. Mérida, 1845. 2 vols.
Regla de la Puríssima Concepcion, Orden que se ha de guardar.
Mexico, n.d.
Regla y Constituciones de las Religiosas Descalzas de la Orden
de la gloriosíssima Vírgen María del monte Carmelo. Madrid,
1733.
Reglamento de las Ordenes militares de Fernando y San
Hermenegildo. Mexico, 1816.
Reglamento de una sociedad para el fomento de la industria
Nacional. Mexico, 1839.
Reglamento en los Hospitales. In Reales Ordenes. tom. ii.
Reglamento para el establecemiento de una Comisaría de guerra.
Mex., 1817. folio.
Reglas de la Compañía de Jesus. Mexico, 1742.
Regulares. A Collection. Mexico, 1809 et seq.
Rejon (Manuel Crecencio), Justificacion de la conducta desde Oct.
de 1841, hasta la fecha. New-Orleans, 1846; Observaciones del
Diputado saliente contra los Tratados de Paz. Querétaro, 1848.
Relacion Anónima de los disturbios acaecidos. In Pacheco and
Cárdenas, Col. Doc., tom. vii.
Relacion de las causas que influyeron los Desgraciados Sucesos.
Mexico, 1847.
Relacion de las Tribulaciones de los Fieles. Mexico, 1804.
Relacion de el Tumulto de 15 Henero 1624 en Mexico con el
Virrey, etc. MS.
Relatione d’alcvne cose della Nuoua Spagna della gran citta de
Temistitan Messico fatta per un gentil’huomo del Signor
Fernando Cortese.
Religion Bethlemítica, Regla y Constituciones. Mexico, 1751.
Religiosas de Santa Brígida, Regla y Constituciones. Mexico,
1822.
Religiosos de la Nueva España, Copia y relacion de las facultades
y breves apostólicos. MS.
Religious Ceremonies and Customs. London, 1731. folio. 3 vols.
Remesal (Antonio de), Historia de la Provincia de S. Vicente de
Chyapa. Madrid, 1619. 4to.
Renta del Tabaco, Instruccion general para los visitadores. n.pl.,
n.d.
Repartimientos de Indios, Parecer del Padre Provincial y otros
religiosos theólogos de la Orden de San Francisco. MS., folio.
Mex., 1594.
Repertorio de Literatura y Variedades. Mejico, 1841-2. 3 vols.
Representacion de los Caporetos al Señor Gobernador del Distrito
Federal. [Mexico, 1833.]
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookgate.com

You might also like