- 160
- 0
- 约1.99万字
- 约 14页
- 2017-03-09 发布于重庆
- 举报
实验2-Gettingclassy
LABORATORY 2 实验2
Getting classy
初窥C++类
姓名: _ ___ 学号: ___________ 班级: Objective 实验目的
Objects are the basic unit of programming in object-oriented languages like C++. The C++ construct for defining new types of objects is the class. A class is the “blueprint” from which an object can be created. This laboratory examines the basic mechanisms of class types by inspecting several different classes. 对象是如C++等面向对象的语言中最基本的程序单位。C++的构造中,定义新的对象类型就是类。类就是用来创建对象的“蓝图”。本次实验的目的就是通过观察几个不同的类来学习类的基本机制。
Key Concepts 相关概念
_ class construct (类的构造)
_ Access specification(访问限定)
_ Information hiding (信息隐藏)
_ Constructors (构造器)
_ Encapsulation (封装)
_ Inspectors ()
_ Data members ()
_ ()
_ Facilitators ()
GETTING STARTED
Using the procedures in the introductory laboratory handout, create the working directory \cpplab on the appropriate disk drive and obtain a copy of self-extracting archive lab02.exe. The copy should be placed in the cpplab directory. Execute the copy to extract the files necessary for this laboratory.
采用实验说明手册中的步骤,在硬盘上合适的位置创建工作目录\cpplab,获取自解压打包文件lab02.exe的一个拷贝,并将其放在cpplab目录中解包得到实验所需的源文件。
Many of the activities that are performed in the laboratory can be done in groups but you should work the exercises yourself.
实验中的许多活动都能在小组中完成,但你应该独立完成这个实验。
CLASSES 类
Objects are the fundamental units of programming in object-oriented languages such as C++. Objects are models of information and are implemented as software packages that contain or encapsulate both attributes and behavior. A data abstraction is a representation of information and the operations to be performed on it.
对象是比如C++这样的面向对象语言中的基础编程单元。对象是信息模型,并被实现为包含或封装了属性和行为的软件模块。数据抽象包括信息的表达和作用在信息上的操作的描述。
A fundamental type is a type that the programming language provides. For example, in C++, the type int and the operations on it are part of the language definition. That is, all C++ compilers must provide int objects. In addition to the fundamental types, C++ provides several mechanisms to define other types. These other typ
您可能关注的文档
最近下载
- 2025年衢州市中考语文试题卷(含答案).docx
- 成人患者医用粘胶相关性皮肤损伤的预防及护理.pptx
- 北京版小学英语1至6年级词汇表(带音标).pdf VIP
- L13S2 给水工程标准图集.pdf VIP
- 2026年春季北师大版(2024)二年级下册数学教学计划附教学进度表.docx VIP
- 第6课华灯梦敦煌(课件)-岭南美版初中美术七年级下册.pptx
- 2023年主任医师(正高)-重症医学(正高)考试历年真题集锦附答案.docx VIP
- 建设工程工程量清单计价规则CQQDGZ-2013.ppt VIP
- 生物-江苏省苏州市2024-2025学年2025届高三第一学期学业期末质量阳光指标调研卷试题和答案.docx VIP
- 演出器材租赁合同(标准版).docx VIP
原创力文档

文档评论(0)