首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 图书频道 > 计算机与网络 > 软件工程 >

程序设计基础(第3版)(影印版)

2010-02-10 
基本信息·出版社:清华大学出版社 ·页码:378 页 ·出版日期:2009年05月 ·ISBN:7302198071/9787302198079 ·条形码:9787302198079 ·版本:第1版(影 ...
商家名称 信用等级 购买信息 订购本书
程序设计基础(第3版)(影印版) 去商家看看
程序设计基础(第3版)(影印版) 去商家看看

 程序设计基础(第3版)(影印版)


基本信息·出版社:清华大学出版社
·页码:378 页
·出版日期:2009年05月
·ISBN:7302198071/9787302198079
·条形码:9787302198079
·版本:第1版(影印版)
·装帧:平装
·开本:16
·正文语种:中文
·丛书名:大学计算机教育国外著名教材系列
·外文书名:Concise Prelude to Programming Concepts and Design Third Edition

内容简介 《程序设计基础》是一本关于程序设计的教材,它围绕程序设计初学者面对的中心问题(即如何构思算法)来介绍程序设计中的主要基本概念和设计方法,包括“程序设计开发的过程、选择结构、重复结构、数组、文件”等,并介绍了主要的基本算法、冒泡排序、串行搜索等,给出了很多生动有趣的例子进行讲解。在算法最终描述时,以VB与C++为例,对一些程序进行对比实现。这样,既让学生可以在与语言无关的算法介绍中学习算法思想,又使他们能够自己动手进行实际的编程练习。

本书各章节后面配有丰富的练习题,很有针对性,网上配套资源也很实用,不仅非常适合作为程序设计的教材,也很适合读者自学使用。
编辑推荐 【本书特点】
1.《程序设计基础》是一般性的编程问题,如数据类型、控制结构、数组、文件,以及子程序。
2 结构化编程的原则,如自顶向下的模块化设计、规范的程序文档和风格。
3.基本工具和算法,如数据检验、防御性编程,总和与均值的计算,列表搜索与排序。
4.包含了多种多样的练习题,如自测题、复习题和编程题等。
5.本书配套网站提供了多种辅助材料。
目录
第0章 绪论
第1章 程序设计概述
第2章 程序开发
第3章 选择结构:做决策
第4章 重复结构:循环
第5章 数组:列表与表格
第6章 顺序数据文件
Brief Contents
.
Contents xiii
0 Introduction 1
1 An Introduction to Programming 27
2 Developing a Program 69
3 Selection Structures: Making Decisions 123
4 Repetition Structures: Looping 177
5 Arrays: Lists and Tables 239
6 Sequential Data Files 301
Study Skills 341
Glossary 351
Index 365
xI

Contents

0 Introduction 1
0.1 Computers EveryWhere 1
0.Z A Brief History of Computers 2
What is a Computers 2
Early Computers 2
Personal Computers 5
TOday's Computers 6
The Internet 7
O.3 Computer Basics 9
The Central Processing Unit 10
Internal Memory 11
Mass Storage Devices 12
Input Devices 14
Output Devices 14
0.4 Software and Programming Languages 16
Types of Software 16
Types of Programming Languages 18
Chapter Review and EXercises 21
1 An introduction to Programming 27
In the Everyday World: You Are Already a Programmer! 28
1 .1 What is Programming? 28
A General Problem-Solving Strategy 29
Creating Computer Programs: The Program Development Cycle 31
1 .2 Basic Programming Concepts 3Z
A Simple Program 32
The Price Conversion Program 33
Data input 35
The input and Write Statements 36
xIII

.
Xlv Contents
Use Input Prompts 37
Other Forms of input 37
Program Variables and Constants 37
Variables Names 39
Variable Names Should Be Meaningful! 39
What's Really Going On with Variables in the Computer? 40
y Going On with Variables in the Computer? 40
1 .3 Data Processing and Output 41
Processing Data 41
The Set Statement 42
Assigning and Reassigning Values to Variables 42
rum f; airy+ry d 7
Operations on Data 43
Hierarchy of ODerations 44
y of Operations 44
Data Output 46
The Write Statement Revisited 47
Annotate Your Output 48
1 .4 TyDes of Data 50
ypes of Data 50
Numeric Data 51
Integers 51
b
Dividing Integers 52
o Integers 52
Real Numbers 52
The Declare Statement 53
The Last Word on Price Conversion 54
Scientific and Exponential Notation 55
Character String Data 57
The Character Data Type 58
ape 58
Operating on Strings 58
Chanter Review and EXercises 6J
pier Review and EXercises 6J

2 Developing a Program 69
In the Everyday World: Planning to Program7 You Need a Plan 7O
2.1 The Program Development Cycle 71
The Process of Developing a Program 71
Analyze the Problem 71
yze the Problem 71
Design the Program 72
an the Program 72
Code the Program 73
Test the Program 74
Additional Steps in the Cycle 76
2.2 Program Design 80
Modular Programming 80
Using Modules and Submodules 81
Benefits of Modular Programming 81
Provide a Welcome Message at the Beginning of Your Program 86

Contents xv
2.3 Coding, Documenting, and Testing a Program 90
Coding and Documenting a Program 90
How Can a Computer Know What to ignore? 91
External Documentation 93
Types of Errors 94
2.4 Commercial Programs: Testing and Documenting 95
The Testing Phase Revisited 96
External Documentation 97
The User's Guide 97
The Program Maintenance Manual 98
Design Documentation 98
Trade Study Documentation 99
2.5 Structured Programming 100
Flowcharts 100
Control Structures 101
The Sequential Structure 101
Loop or Repetition Structures 103
Decision or Selection Structures 103
Z.6 An introduction to OOP and CUls 106
GUls and Event-Driven Programming 106
Object-Oriented Programming 110
Object-Oriented Programming Design 112
Everyone Needs Structured Programming 114
Chapter Review and EXercises ]15
3 Selection StructUres: Making Decisions 123
In the Everyday World: Decisions, decisions, decisions... IZ4
3.1 An Introduction to Selection Structures 125
Types of Selection Structures 125
Single- and Dual-Alternative Structures 127
Single-Alternative Structure: The if -Then Structure 127
Dual-Alternative Structure: The if -Then - Else Structure 129
3.2 Relational and Logical Operators 133
Relational Operators 133
A Little More Explanation about Relational Operators 134
Logical Operators 137
Truth Tables for the OR, AND, and NOT Operators 138
Compounding the Compound Condition issue 140
Hierarchy of Operations 143
3.3 Selecting from Several Alternatives 146
Using if Structures 147
The Action of a Case Statement 150

.
Xvi Contents
3.4 Applications of Selection Structures 154
Defensive Programming 154
Menu-Driven Programs 158
3'5 FOcus on Problem Solving:
A New Car Price Calculator 161
Problem Statement 161
Problem AnalVsis 162
y3ls 162
Program Design 162
blain Design 162
Program Code 166
brain Code 166
Program Test 166
brain rest 166
Chanter Review and EXercises ]67
pier Review and EXercises ]67
4 Repetition Structures: Looping 177
In the Everyday WOrld: Loops 178
4.1 An Introduction to Repetition Structures: Computers
Never Cet Bored! 179
A Simple Example of a Loop 179
Beware of the Infinite Loop! 181
Relational and Logical Operators 183
Pre-Test and Post-Test Loops 184
4.2 CounteFControlled Loops 189
Constructing a Counter-Controlled Loop 190
Summing' How a Computer Adds 190
Counting UP, Down, and Every Way 193
Built-In Counter-Controlled Loops 193
The Careful Beau Counter 197
4.3 Applications of Repetition Structures 202
Using Sentinel-Controlled Loops to input Data 202
Data Validation 204
4.4 Nested Loops 215
Nested For Loops 215
Nesting Other Kinds of Loops 218
Nesting Loops and Selection Structures 220
4'5 FOcus on Problem Solving:
A Cost, Revenue, and Profit Problem 223
Problem Statement 223
Problem Analysis 224
j>Is 224
Program Design 226
Program Code 229
brain Code 229
Program Test 230
brain test 230
Chapter Review and Exercises 232
pier Review and Exercises 232

Contents xvii
5 Arrays: Lists and Tables 239
In the Everyday World: Arrays 24O
yday World: Arrays 24O
5'1 One-Dimensional Arrays 241
ys 241
Array Basics 241
y Basics 241
Declaring ArraVs 242
b Arrays 242
Parallel Arrays 248
ys 248
Some Advantages of Using ArraVs 252
bes of Using Arrays 252
5.Z Searching and Sorting Array 256
g and Sorting ArrayS 256
The Serial Search Technique 256
i he Serial Search Technique 256
The Bubble Sort Technique 261
Other Sorts of Sorting 271
5'3 Other Uses of Arrays 272
ys 272
Strings As ArraVs of Characters 277
e> As Arrays of Characters 272
Declaring an ArraV As a Data TVDe 272
b an Array As a Data Type 272
String Length versus Array Size j74
o Length versus Array Size 274
5'4 Two-Dimensional Array 277
,s 277
An Introduction to Two-Dimensional Arrays 277
ys 277
Declaring Two-Dimensional ArraVs 278
b two-Dimensional Arrays 278
Using Two-Dimensional ArraVs 279
a two-Dimensional Arrays 279
5.5 Focus on Problem Solving.
5.
An invoice Preparation Program 284
Problem Statement 284
Problem Analysis 285
ysls 285
Program Design 285
Program Code 290
Program Test 291
Chanter Review and Exercises 292
pier Review and Exercises 292
6 Sequential Data Files 301
In the EvervdaV WOrld: Data Files 302
yday WOrld: Data Files 302
6.1 An Introduction to Data Files 3O3
File Basics 303
Creating and Reading Seauential Files 306
b and Reading Sequential Files 306
6.Z Modifying a Seauential File 312
ying a Sequential File 312
Deleting Records 314
b Records 314
ModifVing Records 316
ying Records 316
Inserting Records 317
b Records 317
Using ArraVs in File Maintenance 320
o Arrays in File Maintenance 320
6.3 Mereing Seauential Files 322
ging Sequential Files 322

...
xvill Contents
6.4 Focus on Problem Solving:
Control Break Processing 326
Problem Statement 326
Problem Analysis 327
j
Program Design 328
Program Code 331
Program Test 332
blain rest 332
Chanter Review and EXercises 333
pier Review and EXercises 333
<.. c 1. I I
study skills 341
y Skills 341
Clossary 351
y 351
Index 365
……
序言 Concise Prelude to Programming: Concepts & Design provides a language-inde-pendent introduction to programming concepts that helps students learnthe following:
General programming topics, such as data types, control structures,arrays, files, and subprograms
Structured programming principles, such as top-down modular design and proper program documentation and style
Basic tools and algorithms, such as data validation, defensive programming, sums and averages computation, and list searching and
sortingNo prior computer or programming experience or any special knowledge ofmathematics, finance, or other discipline is necessary.
文摘 插图:


2.5 Structured Programming
Structured programming is a method used to design and code programsin a systematic, organized manner. In this chapter, we have already discussed some structured programming principles: follow the steps of theprogram development cycle; design a program in a topdown, modular fashion; and use comments to document a program. In this section, we introduce two more aspects of structured programming: designing each moduleas a sequence of control structures and using good programming style. Webegin by discussing the use of flowcharts in program design.
Flowcharts
In Section 2.2, we introduced two devices to aid in the design of a program:hierarchy charts and pseudocode. Each of these techniques has its place inprogram design. Hierarchy charts identify the program modules and showthe relationships among them. Pseudocode fills in the details of how themodules are to be coded.
Another common program design tool is the flowchart, which is a diagramthat uses special symbols to display pictorially the flow of execution withina program or program module. Flowcharts help you visualize how a programwill actually flow. A flowchart provides an easy, clear way to see which piecesof your code follow the various programming structures that all programsare constructed from. These structures are discussed in detail in this section. The basic symbols in a flowchart are shown in Figure 2.5.
热点排行