定 价:69.8 元
丛书名:
抱歉,电子工业出版社不参与样书赠送活动!
- 作者:方潜生
- 出版时间:2025/9/1
- ISBN:9787121512735
- 出 版 社:电子工业出版社
适用读者:高等院校计算机专业的本科生、专科生、研究生。
- 中图法分类:TP312.8
- 页码:292
- 纸张:
- 版次:01
- 开本:16开
- 字数:621(单位:千字)
本书将C++程序设计语言作为描述工具,对面向对象程序设计及统一建模语言UML进行介绍。内容包括:C++基础知识、函数、数组、指针和字符串、I/O流对象、类和数据抽象、友元函数、重载操作符、继承、多态性、模板等。本书由浅入深,由日常生活及工程应用案例,逐步引入面向对象程序设计基本概念和方法。每章提供案例研究,后续部分章节提供综合案例分析。案例研究及分析注重讲解使用UML进行程序设计的方法,使面向对象设计与C++程序设计语言相结合,提高学生利用对象思维解决实际问题的能力。本书既可作为高等学校计算机相关专业面向对象程序设计双语教材,也可作为留学生相关课程教材。
方潜生,男,博士,教授、校党委书记。本科毕业于武汉测绘科技大学,硕士毕业于中国科学技术大学计算机应用专业,博士毕业于中国科技大学计算机应用专业。参加的学术组织:全国土建学科教学指导委员会委员,安徽省智能建筑重点实验室主任,全国智能建筑指导小组成员,安徽省计算机学会常务理事、副理事长,安徽省智能建筑学会常务理事、副理事长,安徽省高校计算机教育研究会常务理事、副理事长,《计算机与信息技术》杂志社副社长。已出版的教材:《建筑电气》,2010年,中国建筑工业出版社;《嵌入式微计算机系统实时接口技术》,2003,机械工业出版社;《建筑智能化概论》,2007,中国电力出版社;《智能建筑实验指南》,2003年,人民交通出版社。教学及科研获奖情况:(1)浮法玻璃微缺陷控制与节能关键技术及产业化应用,201年,国家科技进步二等奖:(2)大型公共建筑节能监管体系关键技术研发与应用,2014年,安徽省科技进步二等奖;(3)智能配电一体化监控管理系统开发及其产业化,2011年,安徽省科技进步一等奖;(4) 面向多领域的通用低频自动测试系统平台,2010 年,安徽省科技进步二等奖;(5)地方特色型院校学科专业结构优化及构建多样化人才培养模式的研究与实践,2009年,国家教学成果奖二等奖;(6)打好"建”字牌 做好"徽”文章 走好应用路——地方行业大学特色办学探索与发展路径实践,2015年,安徽省教学成果特等奖;(7)以评估制度为核心构建教学质量保障体系长效机制的研究与实现,2013年,安徽省教学成果一等奖;(8)科学定位与特色办学的研究与实践—以安徽建筑工业学院为例,2012年,安徽省教学成果特等奖;(9)质量工程三级建设体系的探索与实践,2010年,安徽省教学成果特等奖.;(10)建筑类高校信息类专业人才培养模式探索与实践,2008年,安徽省教学成果一等奖;(11)安徽省学术和技术带头人,2015年;(12)安徽省教学名师,2013年;(13)安徽省高校学科拔尖人才,2005年;(14)全国优秀教师 ,2004年;(15)《面向对象的程序设计》课程获国家级双语教学示范课程,2009年;(16)《微机原理与接口技术》课程获省级精课程,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