C++程序设计:程序设计和面向对象设计入门

C++程序设计:程序设计和面向对象设计入门
作 者: James Cohoon Jack Davidson
出版社: 清华大学出版社
丛编项: 大学计算机教育丛书(英文影印版)
版权说明: 本书为公共版权或经版权方授权,请支持正版图书
标 签: C++
ISBN 出版时间 包装 开本 页数 字数
未知 暂无 暂无 未知 0 暂无

作者简介

暂缺《C++程序设计:程序设计和面向对象设计入门》作者简介

内容简介

本书介绍使用C++进行程序设计和软件开发的基本原理,适用作大学各专业学生学习面向对象程序设计课的教材。全书共15章:1、计算机和面向对象设计方法学;2、C++基础;3、限定对象;4、控制构造;5、使用基本库函数;6、程序员自定义函数;7、类构造和面向对象设计;8、实现抽象数据类型;9、列表;10、EzWindows API图形库;11、指针和动态内存管理;12、测试和排错;13、继承;14、模板和多态性;15、软件开发项目。本书遵循C++国际标准(ISO/IEC FDIS 14882;X3J16//97-14882);增添了新的语言类型(bool,namespaces和exceptions)。为帮助初学者,作者开发了可移植的面向对象图形库(EzWindows)和标准模板库(STL)。根据使用者的建议,作者在本书中增加一章测试和排错。本书附CD-ROM一张。本书按C++国际标准补充了150个标准类;添加了许多有价值的例子和练习。

图书目录

Preface

Chapter 1 Computing and the object-oriented design methodology

1.1 Basic computing terminology

Self-check questions

1.2 Software

1.3 Engineering software

1.4 Object-oriented design

Self-check questions

1.5 Points to remember

1.6 To delve further

1.7 Exercises

Chapter 2 C++:The fundamentals

2.1 Program organization

2.2 A first program

2.3 A second program

2.4 Comments

Self-check questions

2.5 Assigning a value

2.6 Fundamental C++objects

2.7 Constants

Self-check questions

2.8 Names

2.9 Definitions

Self-check questions

2.10 Expressions

Self-check questions

2.11 Output statements

2.12 Computing average velocity

Self-check questions

2.13 Points to remember

2.14 Exercises

Chapter 3 Modifying objects

3.1 Assignment

3.2 Const definitiions

3.3 Input statements

Self-check questions

3.4 Computing the number of molecules in a hydrocarbon

3.5 Compound assignment

3.6 Increment and decrement

Self-check questions

3.7 Estimating yearly savings of change

3.8 The string class

Self-check questions

3.9 EzWindows

3.10 Mowing lawns

Self-check questions

3.11 Points to remember

3.12 Exercises

Chapter 4 Control constructs

4.1 Boolean algebra

4.2 A Boolean type

Self-check questions

4.3 Conditional execution using the if statement

Self-check questions

4.4 Conditional execution using the switch statement

4.5 Computing a requested expression

4.6 Validating a date

Self-check questions

4.7 Iteration using the while statement

4.8 Simple string and character processing

Self-check questions

4.9 Iteration using the for construct

4.10 Simple data visualization

4.11 Solving the lazy hobo riddle

4.12 Iteration using the do construct

Self-check questions

4.13 Points to remember

4.14 Exercises

Chapter 5 Function basics

5.1 Function basic

5.2 The preprocessor

Self-check questions

5.3 Using software libraries

5.4 The iostream library

5.5 The iomanip library

5.6 The fstream library

5.7 Random numbers

5.8 The assert library

Self-check questions

5.9 Points to Remember

5.10 To delve further

5.11 Exercises

Chapter 6 Programmer-defined Functions

6.1 Basics

6.2 A tasty problem

6.3 Some useful functions

6.4 Integrating a quadratic polynomial

6.5 The local scope

6.6 The global scope

Self-check questions

6.7 Reference parameters

6.8 Passing objects by reference

6.9 Validating telephone access codes

Self-check questions

6.10 Constant parameters

6.11 Default parameters

6.12 Casting of function parameters

6.13 Function overloading

Self-check questions

6.14 Recursive functions

Self-check questions

6.15 Displaying a price-interval stock chart

6.16 Points to Remember

6.17 To delve further

6.18 Exercises

Chapter 7 The class construct and object-oriented design

7.1 Introducing a programmer-defined data type

7.2 The RectangleShape class

Self-check questions

7.3 Using the RectangleShape class

7.4 Constructors

Self-check questions

7.5 Building a kaleidoscope

7.6 Object-oriented analysis and design

7.7 Points to remember

7.8 To delve further

7.9 Exercises

Chapter 8 Implementing abstract data types

8.1 Introducing abstract data types

8.2 Rational ADT basics

8.3 Rational interface description

Self-check questions

8.4 Implementing the rational class

8.5 Copy construction,member assignment,and destruction

Self-check questions

8.6 ADT for pseudorandom integers

8.7 Red-yellow-green game

8.8 Points to remember

8.9 Exercises

Chapter 9 Lists

9.1 Named collections

9.2 One-dimensional arrays

Self-check questions

9.3 Arrays as parameters

9.4 Sorting

Self-check questions

9.5 Container classes

9.6 Class vector

9.7 QuickSort

9.8 Binary searching

9.9 String class revisited

Self-check questions

9.10 Find that word-exploring a two-dimensiional list

9.11 Maze runner

9.12 Multidimensional arrays

Self-check questions

9.13 Points to remember

9.14 Exercises

Chapter 10 The EzWindows API:a detailed examination

10.1 Application programmer interfaces

10.2 A simple window class

10.3 The bitmap class

10.4 Mouse events

10.5 Bitmaps and mouse events

10.6 Timer events

10.7 Alert messages

Self-check questions

10.8 Simon says

10.9 Points to remember

10.10 Exercises

Chapter 11 Pointers and dynamic memory

11.1 Lvalues and rvalues

11.2 Pointer basic

Self-check questions

11.3 Constant pointers and pointers to constants

11.4 Arrays and pointers

11.5 Character string processing

11.6 Program command-line parameters

Self-check questions

11.7 Pointers to functions

Self-check questions

11.8 Dynamic objects

11.9 A simple ADT for representing lists of integer values

Self-check questions

11.10 Points to remember

11.11 Exercises

Chapter 12 Testing and debugging

12.1 Testing

Self-check questions

Self-check questions

12.2 Debugging

Self-check questions

12.3 Points to remember

12.4 To Delve Further

12.5 Exercises

Chapter 13 Inheritance

13.1 Object-oriented design using inheritance

13.2 Reuse via inheritance

13.3 A hierarchy of shapes

Self-check questions

13.4 Protected members and inheritance

13.5 Controlling inheritance

Self-check questions

13.6 Multiple inheritance

Self-check questions

13.7 A prettier kaleidoscope

13.8 Points to remember

13.9 Exercises

Chapter 14 Templates and polymorphism

14.1 Generic actions and types

14.2 Function templates

14.3 Class templates

14.4 A simple list class using a class template

Self-check questions

14.5 Sequential lists

Self-check questions

14.6 Polymorphism

14.7 Virtual function nuances

14.8 Abstract base classes

14.9 Virtual multiple inheritance

Self-check questions

14.10 Points to remember

14.11 Exercises

Chapter 15 Software project-Bug Hunt!

15.1 Bug hunt

15.2 Base class Bug

15.3 Class GameController

15.4 Bug hunt

Self-check questions

15.5 Points to remember

15.6 Exercises

Appendix A Tables

A.1 ASCII character set

A.2 Operator precedence

Appendix B Standard libraries

B.1 Library naming and access

B.2 Iostream library

B.3 Stdlib library

B.4 Math library

B.5 Time library

B.6 Cstring library

B.7 Algorithm library

Appendix C Standard classes

C.1 Container Classes

C.2 Class string

Appendix D Advanced topics

D.1 Namespaces

D.2 Exception handling

D.3 Friends

Appendix E EzWindows API reference manual

E.1 Enumerated types

E.2 Coordinate system

E.3 Class Position

E.4 Class SimpleWindow

E.5 Class WindowObject

E.6 Class RaySegment

E.7 Class Shape

E.8 Class EllipseShape

E.9 Class CircleShape

E.10 Class RectangleShape

E.11 Class TriangleShape

E.12 Class SquareShape

E.13 Class Label

E.14 Class BitMap

E.15 Class Randomlnt

E.16 Miscellaneous functions

Appendix F Projects and makefiles

F.1 Project and makefile fundamentals

F.2 Borland C++ IDE

F.3 Microsoft Visual C++ IDE

F.4 UNIX Makefiles

Index