did-you-know? rent-now

Amazon no longer offers textbook rentals. We do!

did-you-know? rent-now

Amazon no longer offers textbook rentals. We do!

We're the #1 textbook rental company. Let us show you why.

9780132167390

Prelude to Programming : Concepts and Design

by ;
  • ISBN13:

    9780132167390

  • ISBN10:

    0132167395

  • Edition: 5th
  • Format: Paperback
  • Copyright: 2010-11-04
  • Publisher: Addison-Wesley
  • View Upgraded Edition
  • Purchase Benefits
  • Free Shipping Icon Free Shipping On Orders Over $35!
    Your order must be $35 or more to qualify for free economy shipping. Bulk sales, PO's, Marketplace items, eBooks and apparel do not qualify for this offer.
  • eCampus.com Logo Get Rewarded for Ordering Your Textbooks! Enroll Now
List Price: $130.20

Summary

Prelude to Programming provides beginning students with a language-independent framework for learning core programming concepts and effective design techniques. This approach gives students the foundation they need to understand the logic behind program design and to establish effective programming skills.

The Fifth Edition offers students a lively and accessible presentation as they learn core programming concepts – including data types, control structures, data files and arrays, and program design techniques such as top-down modular design and proper program documentation and style. Problem-solving skills are developed when students learn how to use basic programming tools and algorithms, which include data validation, defensive programming, calculating sums and averages, and searching and sorting lists. A copy of the RAPTOR flow-charting software is included with the Fifth Edition.

Author Biography

Stewart Venit received a PhD in mathematics from the University of California, Berkeley in 1971. For the past two decades, he has taught mathematics at California State University in Los Angeles. Professor Venit is a past department Chair and recipient of the University’s Outstanding Professor Award. He has authored numerous journal articles and ten textbooks for mathematics or computer science.

Elizabeth Drake has worked full time as a professor in the ITE and Math Departments at Santa Fe CC since 1999. Before that, she was an adjunct professor and lecturer in Math, Computer Science, Physics, and Anthropology at SFC, UF, Three Rivers Community College in Connecticut, and the University of Connecticut. She has earned Master's degrees in Anthropology (A.B.D.) and Counseling, a B.S.E.E. in Electrical Engineering, a B.S. in Physics, B.A. in  Sociology, and A.S. in Computer Information Technology.

Table of Contents

Preface xv
0 Introduction 1
In the Everyday World: Computers Everywhere 2
0.1 A Brief History of Computers 2
What Is a Computer? 2
Personal Computers 4
The Internet 7
0.2 Computer Basics 8
The Central Processing Unit 9
Internal Memory 9
Mass Storage Devices 10
Input Devices 12
Output Devices 12
0.3 Software and Programming Languages 14
Types of Software 14
Types of Programming Languages 15
Chapter Review and Exercises 18

1 An Introduction to Programming 23
In the Everyday World: You Are Already a Programmer! 24
1.1 What Is Programming? 24
A General Problem-Solving Strategy 25
Creating Computer Programs: The Program Development Cycle 26
1.2 Basic Programming Concepts 27
A Simple Program 28
Data Input 30
Program Variables and Constants 32
1.3 Data Processing and Output 35
Processing Data 35
Data Output 39
1.4 Character and String Data 43
The Declare Statement 43
1.5 Integer Data 46
Operations on Integers 47
The Binary Number System 48
Integer Representation 50
1.6 Floating Point Data 55
The Declare Statement Revisited 56
Types of Floating Point Numbers 57
Floating Point Representation 59
Chapter Review and Exercises 62

2 Developing a Program 69
In the Everyday World: Planning to Program? You Need a Plan 70
2.1 The Program Development Cycle 71
The Process of Developing a Program 71
Additional Steps in the Cycle 74
2.2 Program Design 78
Modular Programming 78
2.3 Coding, Documenting, and Testing a Program 86
Coding and Documenting a Program 87
Testing a Program 89
Types of Errors 89
2.4 Commercial Programs: Testing and Documenting 91
The Testing Phase Revisited 91
External Documentation 92
2.5 Structured Programming 94
Flowcharts 94
Control Structures 99
Programming Style 102
Chapter Review and Exercises 104

3 Selection Structures: Making Decisions 111
In the Everyday World: Decisions, Decisions, Decisions... 112
3.1 An Introduction to Selection Structures 113
Types of Selection Structures 113
Single- and Dual-Alternative Structures 114
3.2 Relational and Logical Operators 120
Relational Operators 120
Logical Operators 123
Hierarchy of Operations 128
3.3 ASCII Code and Comparing Strings 130
Representing Characters by Numbers 130
3.4 Selecting from Several Alternatives 133
Using If Structures 134
Using Case-Like Statements 137
3.5 Applications of Selection Structures 141
Defensive Programming 141
Menu-Driven Programs 144
3.6 Focus on Problem Solving: A New Car Price Calculator 147
Problem Statement 147
Problem Analysis 147
Program Design 148
Program Code 151
Program Test 151
Chapter Review and Exercises 152

4 Repetition Structures: Looping 163
In the Everyday World: Loops 164
4.1 An Introduction to Repetition Structures:
Computers Never Get Bored! 165
Loop Basics 165
Relational and Logical Operators 168
Constructing Flowcharts with a Loop Structure 169
4.2 Types of Loops 172
Pre-Test and Post-Test Loops 173
Counter-Controlled Loops 177
4.3 The For Loop 183
The For Statement 184
The For Loop in Action 187
The Careful Bean Counter 190
4.4 Applications of Repetition Structures 195
Using Sentinel-Controlled Loops to Input Data 195
Data Validation 199
The Floor() and Ceiling() Functions 203
Computing Sums and Averages 206
4.5 Focus on Problem Solving: A Cost, Revenue, and Profit Problem 211
Problem Statement 211
Problem Analysis 211
Program Design 213
Program Code 216
Program Test 216
Chapter Review and Exercises 218

5 More about Loops and Decisions 225
In the Everyday World: Advanced Loops 226
5.1 Combining Loops with If-Then Statements 226
Exiting a Loop Early 227
5.2 Combining Loops with If-Then Structures in Longer Programs 236
The Length_of() Function 242
The Print Statement and the New Line Indicator 242
5.3 Random Numbers 246
The Random Function 247
Not Really Random: The Pseudorandom Number 251
5.4 Nested Loops 252
Nested For Loops 253
Nesting Other Kinds of Loops 257
A Mental Workout: Mind Games 262
5.5 Focus on Problem Solving: A Guessing Game 269
Problem Statement 270
Problem Analysis 270
Program Design 271
Program Code 276
Program Test 276
Chapter Review and Exercises 278

6 Arrays: Lists and Tables 285
In the Everyday World: Arrays 286
6.1 One-Dimensional Arrays 287
Array Basics 287
Parallel Arrays 293
Some Advantages of Using Arrays 296
6.2 Searching and Sorting Arrays 300
The Serial Search Technique 300
The Bubble Sort Technique 304
6.3 More about Searching and Sorting 312
Binary Search 313
Selection Sort 317
6.4 Strings as Arrays of Characters 322
Concatenation Revisited 323
String Length versus Array Size 324
6.5 Two-Dimensional Arrays 326
An Introduction to Two-Dimensional Arrays 326
Using Two-Dimensional Arrays 328
6.6 Focus on Problem Solving: A Grade Management Program 332
Problem Statement 333
Problem Analysis 333
Program Design 335
Program Code 341
Program Test 341
Chapter Review and Exercises 342

7 Program Modules, Subprograms, and Functions 351
In the Everyday World: Living and Programming in Manageable
Pieces: Subprograms 352
7.1 Data Flow Diagrams and Parameters 353
The Big Sale: The Sale Price Computation Program 353
Data Flow Diagrams 354
An Introduction to Arguments and Parameters 355
7.2 More about Subprograms 362
Value and Reference Parameters 362
How to Tell the Difference between Value and Reference Parameters 363
Two Helpful Functions: ToUpper() and ToLower() 367
The Scope of a Variable 370
7.3 Functions 374
Built-in Functions 374
User-Defined Functions 378
7.4 Recursion 382
The Recursive Process 383
7.5 Focus on Problem Solving: A Grade Management Program 388
Problem Statement 388
Problem Analysis 388
Program Design 388
Program Code 395
Program Test 396
Chapter Review and Exercises 398

8 Sequential Data Files 405
In the Everyday World: Data Files 406
8.1 An Introduction to Data Files 407
File Basics 407
Creating and Reading Sequential Files 409
8.2 Modifying a Sequential File 415
Deleting Records 415
Modifying Records 418
Inserting Records 419
Using Arrays in File Maintenance 421
8.3 Merging Sequential Files 423
8.4 Focus on Problem Solving: Control Break Processing 426
Problem Statement 427
Problem Analysis 427
Program Design 429
Coding and Testing the Program 431
8.5 Focus on Problem Solving: The Invoice Preparation Program 432
Problem Statement 432
Problem Analysis 432
Program Design 434
Program Code 438
Program Test 438
Chapter Review and Exercises 439

9 An Introduction to Object-Oriented Programming 447
In the Everyday World: Objects 448
9.1 Classes and Objects 448
Classes 448
Defining Classes and Creating Objects 450
Creating Objects 453
The Constructor 454
9.2 More Features of Object-Oriented Programming 456
Benefits of Object-Oriented Languages 456
Inheritance and Polymorphism 456
9.3 Object-Oriented Program Design and UML 468
Modeling Languages 470
Unified Modeling Language 471
9.4 Focus on Problem Solving: Using OOP to Create the Parking Lot
Program 474
Problem Statement 474
Problem Analysis 474
Program Design 476
Creating the Necessary Submodules 482
Program Code 485
Program Test 485
Chapter Review and Exercises 486

Appendix A: Decimal, Binary, and Hexadecimal Representation 493
A.1 Bases and Exponents 493
Expanded Notation 494
A.2 The Binary System 495
Converting Binary to Decimal 497
A.3 The Hexadecimal System 497
Hexadecimal Digits 498
Converting Decimal to Hexadecimal 498
Converting Hexadecimal to Decimal 500
Using Hexadecimal Notation 500
Converting Binary to Hexadecimal 501

Appendix B: Integer Representation 503
B.1 Unsigned Integer Format 503
Overflow 504
B.2 Sign and Magnitude Format 504
Representation of Sign-and-Magnitude Integers 505
The Zero 506
B.3 One’s Complement Format 506
The Zero Again 507
B.4 Two’s Complement Format 508
The Two’s Complement Zero 511
Why the Two’s Complement Works 512

Appendix C: Floating Point Number Representation 513
C.1 Binary Conversions to Floating Point 513
Floating Point Numbers–the Integer Part 513
Floating Point Numbers–the Fractional Part 513
Converting a Decimal Fraction to Binary 515
C.2 Putting the Two Parts Together 517
C.3 Scientific and Exponential Notation 518
Scientific Notation 518
Exponential Notation 519
C.4 Base 10 Normalization 520
C.5 Normalizing Binary Floating Point Numbers 520
The Excess_127 System 521
Base 2 Normalization 521
Single Precision Floating Point Numbers 522
C.6 Hexadecimal Representation 525

Appendix D: Introduction to RAPTOR 527
D.1 What Is RAPTOR? 527
D.2 Getting Started 527
D.3 Introduction to RAPTOR Symbols and Variables 530
Variables 530
D.4 RAPTOR Symbols 533
Input Symbol 533
Assignment Symbol 535
Output Symbol 538
D.5 Comments 539
D.6 Built-in Operators and Functions 541
Built-in Constants 542
Relational Operators 542
Boolean (Logical) Operators 543
D.7 Making Decisions: The Selection Symbol 543
D.8 Repetition: The Loop Symbol 544
D.9 The Call Symbol and Subcharts 547
D.10 Arrays 549
D.11 Creating and Displaying Data Files 550
The Redirect_Output Procedure 550
The Redirect_Input Procedure 553
The End_Of_Input Function 553
D.12 Object-Oriented Mode 554
Creating a Class 556
Example: Using the Cube Class to Find the Volume of a Cube 557
Code the Methods 560
The Main Program 563
Inheritance and Polymorphism 564

Glossary 565
Index 585

Supplemental Materials

What is included with this book?

The New copy of this book will include any supplemental materials advertised. Please check the title of the book to determine if it should include any access cards, study guides, lab manuals, CDs, etc.

The Used, Rental and eBook copies of this book are not guaranteed to include any supplemental materials. Typically, only the book itself is included. This is true even if the title states it includes any access cards, study guides, lab manuals, CDs, etc.

Rewards Program