C++面向?qū)ο蟪绦蛟O(shè)計(英文版)
定 價:69.8 元
- 作者:方潛生
- 出版時間:2025/9/1
- ISBN:9787121512735
- 出 版 社:電子工業(yè)出版社
- 中圖法分類:TP312.8
- 頁碼:292
- 紙張:
- 版次:01
- 開本:16開
本書將C++程序設(shè)計語言作為描述工具,對面向?qū)ο蟪绦蛟O(shè)計及統(tǒng)一建模語言UML進行介紹。內(nèi)容包括:C++基礎(chǔ)知識、函數(shù)、數(shù)組、指針和字符串、I/O流對象、類和數(shù)據(jù)抽象、友元函數(shù)、重載操作符、繼承、多態(tài)性、模板等。本書由淺入深,由日常生活及工程應(yīng)用案例,逐步引入面向?qū)ο蟪绦蛟O(shè)計基本概念和方法。每章提供案例研究,后續(xù)部分章節(jié)提供綜合案例分析。案例研究及分析注重講解使用UML進行程序設(shè)計的方法,使面向?qū)ο笤O(shè)計與C++程序設(shè)計語言相結(jié)合,提高學生利用對象思維解決實際問題的能力。本書既可作為高等學校計算機相關(guān)專業(yè)面向?qū)ο蟪绦蛟O(shè)計雙語教材,也可作為留學生相關(guān)課程教材。
方潛生,男,博士,教授、校黨委書記。本科畢業(yè)于武漢測繪科技大學,碩士畢業(yè)于中國科學技術(shù)大學計算機應(yīng)用專業(yè),博士畢業(yè)于中國科技大學計算機應(yīng)用專業(yè)。參加的學術(shù)組織:全國土建學科教學指導委員會委員,安徽省智能建筑重點實驗室主任,全國智能建筑指導小組成員,安徽省計算機學會常務(wù)理事、副理事長,安徽省智能建筑學會常務(wù)理事、副理事長,安徽省高校計算機教育研究會常務(wù)理事、副理事長,《計算機與信息技術(shù)》雜志社副社長。已出版的教材:《建筑電氣》,2010年,中國建筑工業(yè)出版社;《嵌入式微計算機系統(tǒng)實時接口技術(shù)》,2003,機械工業(yè)出版社;《建筑智能化概論》,2007,中國電力出版社;《智能建筑實驗指南》,2003年,人民交通出版社。教學及科研獲獎情況:(1)浮法玻璃微缺陷控制與節(jié)能關(guān)鍵技術(shù)及產(chǎn)業(yè)化應(yīng)用,201年,國家科技進步二等獎:(2)大型公共建筑節(jié)能監(jiān)管體系關(guān)鍵技術(shù)研發(fā)與應(yīng)用,2014年,安徽省科技進步二等獎;(3)智能配電一體化監(jiān)控管理系統(tǒng)開發(fā)及其產(chǎn)業(yè)化,2011年,安徽省科技進步一等獎;(4) 面向多領(lǐng)域的通用低頻自動測試系統(tǒng)平臺,2010 年,安徽省科技進步二等獎;(5)地方特色型院校學科專業(yè)結(jié)構(gòu)優(yōu)化及構(gòu)建多樣化人才培養(yǎng)模式的研究與實踐,2009年,國家教學成果獎二等獎;(6)打好"建”字牌 做好"徽”文章 走好應(yīng)用路——地方行業(yè)大學特色辦學探索與發(fā)展路徑實踐,2015年,安徽省教學成果特等獎;(7)以評估制度為核心構(gòu)建教學質(zhì)量保障體系長效機制的研究與實現(xiàn),2013年,安徽省教學成果一等獎;(8)科學定位與特色辦學的研究與實踐—以安徽建筑工業(yè)學院為例,2012年,安徽省教學成果特等獎;(9)質(zhì)量工程三級建設(shè)體系的探索與實踐,2010年,安徽省教學成果特等獎.;(10)建筑類高校信息類專業(yè)人才培養(yǎng)模式探索與實踐,2008年,安徽省教學成果一等獎;(11)安徽省學術(shù)和技術(shù)帶頭人,2015年;(12)安徽省教學名師,2013年;(13)安徽省高校學科拔尖人才,2005年;(14)全國優(yōu)秀教師 ,2004年;(15)《面向?qū)ο蟮某绦蛟O(shè)計》課程獲國家級雙語教學示范課程,2009年;(16)《微機原理與接口技術(shù)》課程獲省級精課程,2005年。
Contents
Chapter 1 Overview of Object-Oriented Programming 1
1.1 Programming 1
1.2 Structured Programming 1
1.3 Object-Oriented Programming 4
1.4 Object-Oriented Programming Languages 6
1.4.1 C++ 6
1.4.2 Java 7
1.4.3 C# 7
1.5 Development Environments and Tools 7
1.5.1 Microsoft Visual Studio Express 7
1.5.2 Microsoft Visual C++ 6.0 8
1.5.3 Code::Blocks 8
1.5.4 Eclipse 8
1.5.5 Dev-C++ 9
1.6 Unified Modeling Language 9
1.6.1 Introduction to Unified Modeling Language 9
1.6.2 UML Tools Comparison 10
1.7 Exercises 12
Chapter 2 C++ Basics 14
2.1 C++ Program Structure 14
2.1.1 Variables and Assignments 14
2.1.2 Input and Output 15
2.1.3 Flow of Control 17
2.1.4 Data Types and Expressions 21
2.2 Functions 25
2.2.1 Basics of Functions 25
2.2.2 Call-by-Reference Parameters 29
2.2.3 Overloading Function Names 30
2.3 Reference 33
2.3.1 Introduction of Reference 33
2.3.2 Reference Variables as Parameters 35
2.3.3 A Reference as a Value-Returning 36
2.4 Case Study 36
2.5 Exercises 39
Chapter 3 Class and Object 42
3.1 Class 43
3.1.1 Definition of Classes 43
3.1.2 Class Scope 45
3.1.3 Member Functions 47
3.2 Constructors and Destructors 50
3.2.1 Constructors 50
3.2.2 Copy Constructors 52
3.2.3 Destructors 56
3.2.4 Sequence of Constructor and Destructor Execution 57
3.3 Friend Functions and Classes 58
3.4 Case Study 61
3.5 Exercises 64
Chapter 4 Object Thinking 69
4.1 Constant Object and Constant Member Function 69
4.1.1 Constant Object 69
4.1.2 Constant Data Members 71
4.1.3 Constant Member Functions 72
4.2 Object Pointer and this Pointer 74
4.2.1 Object Pointer 74
4.2.2 Pointers to Object Members 75
4.2.3 The 'This' Pointer 77
4.3 Static Members 79
4.3.1 Static Data Members 79
4.3.2 Static Member Functions 82
4.4 Object Array 86
4.4.1 Object Array 86
4.4.2 Pointer to an Array of Objects 89
4.4.3 An Array of Pointers to Objects 90
4.5 Class String 91
4.6 Passing an Object to the Function 95
4.6.1 Using an Object as a Function Parameter 95
4.6.2 Using an Object Pointer as a Function Parameter 96
4.6.3 Using Object Parameters as Function Parameters 97
4.7 Object Combination 98
4.7.1 Definition of Object Combination 98
4.7.2 Instantiation for Object Composition 99
4.8 Case Study 104
4.9 Exercises 106
Chapter 5 Overloading Operators 110
5.1 Introduction 110
5.2 Overloading Binary and Unary Operators 111
5.2.1 Overloading Binary Operators 111
5.2.2 Overloading Unary Operators 113
5.3 Overloading Assignment Operator 116
5.4 Overloading Special Operators 118
5.4.1 Overloading Subscript Operator 118
5.4.2 Overloading Function Call Operator 120
5.4.3 Overloading Input/Output Operators 122
5.5 Overloading Type Conversion Operator 124
5.6 Case Study 125
5.7 Exercises 129
Chapter 6 Inheritance 132
6.1 Introduction to Inheritance 132
6.1.1 Base Classes and Derived Classes 132
6.1.2 Declaration of Derived Classes 135
6.1.3 Structure of Derived Classes 136
6.2 Access Control 137
6.2.1 Public Inheritance 138
6.2.2 Private Inheritance 139
6.2.3 Protected Inheritance 140
6.3 Constructors and Destructors of Derived Classes 142
6.3.1 Constructors 142
6.3.2 Copy Constructors 145
6.3.3 Destructors 148
6.4 Multiple Inheritance 149
6.4.1 Definition of Multiple Inheritance 150
6.4.2 Multiple Inheritance Ambiguities 151
6.4.3 Constructors of the Multiple Inheritance 155
6.4.4 Virtual Base Classes 156
6.5 Case Study 158
6.6 Exercises 166
Chapter 7 Polymorphism 170
7.1 Introduction to Polymorphism 170
7.1.1 Categories of Polymorphism 171
7.1.2 Implementation of Polymorphism 172
7.2 Virtual Functions 175
7.2.1 Definition of Virtual Functions 175
7.2.2 Overloading and Overriding 176
7.3 Abstract Base Classes 178
7.3.1 Base Class and Abstract Class 178
7.3.2 An Abstract Base Class and Its Member Functions 179
7.4 Case Study 182
7.4.1 Declare the Base Class Point 182
7.4.2 Declare Derived Class Circle 184
7.4.3 Declare the Derived Class Cylinder of Circle 187
7.5 Exercises 191
Chapter 8 Templates 194
8.1 Introduction 194
8.2 Function Templates 194
8.2.1 Definition of Function Templates 195
8.2.2 Function Template Instantiation 195
8.3 Class Templates 198
8.3.1 Definition of Class Templates 199
8.3.2 Instantiation of Class Template 200
8.4 Case Study 203
8.5 Exercises 207
Chapter 9 I/O Stream 208
9.1 Stream and Basic file I/O 208
9.1.1 Introduction 208
9.1.2 C++ Stream 208
9.1.3 C++ I/O Class 209
9.1.4 File and Basic File I/O 210
9.2 Tools for Stream I/O 211
9.2.1 Ios 211
9.2.2 Defining Field Width 211
9.2.3 Setting Precision 212
9.2.4 Filling, Padding with fill() 213
9.2.5 Formatting Flags with setf() 213
9.2.6 Manipulator 214
9.3 Character I/O 216
9.3.1 Overloaded operators >> and << 216
9.3.2 The put() Function 218
9.3.3 The get() and getline() Functions 218
9.3.4 The read() and write() Functions 221
9.4 Access to Files 223
9.4.1 Opening and Closing a File 223
9.4.2 Checking the End of a File 227
9.4.3 Sequential Access to a File 227
9.4.4 Random Access to a File 229
9.5 Case study 233
9.6 Exercises 235
Chapter 10 Comprehensive Cases Analysis 237
10.1 Student Grade Management System 237
10.2 Object-Oriented Analysis and Design 238
10.2.1 Use Case Diagram 238
10.2.2 Class Diagram 238
10.3 Module Design and Corresponding Code Implementation 241
10.3.1 Sequence Diagram and Code Implementation for System Management 241
10.3.2 Sequence Diagram and Code for Grade Management 243
10.3.3 Sequence Diagram and Code for Grade Query 245
10.4 The Whole C++ Codes of the Project 247
10.4.1 Main Menu of the Project. 247
10.4.2 The Class Admin 251
10.4.3 The Class Course and the Class CourseManage 252
10.4.4 The Class Grade and the Class GradeManage 257
10.4.5 The Class Person and the Class PersonManage 264
10.4.6 The Class Teacher and the Class TeacherManage 269
References 274