文件名称:Box
介绍说明--下载内容均来自于网络,请自行研究使用
一个立方体Box可以视为在一个矩形Rectangle的相互正交的长length和宽width的基础上增加一维与length和width相互正交的高height而生成的。
定义具有继承关系的矩形类Rectangle和立方体类Box。两个类中除了具有共同的属性length和width,还具有相同的接口(公有成员函数)Area(计算矩形面积立方体面积),Perimeter(计算矩形周长或立方体周长),Diagmonal(计算矩形对角线或立方体对角线的长度),GetLength(获取长度属性),GetWidth(获取宽度属性),SetLength(设置长度属性)和SetWidth(设置宽度属性)。除此之外,立方体类Box还需要增加height属性和接口函数Volume(计算立方体的体积),GetHeight(获取高度属性)和SetHeight(设置高度属性)。(不需要考虑构造函数)-Box can be viewed as a cube in a mutually orthogonal rectangle Rectangle long length and width width based on the increase with the length and width one-dimensional orthogonal generated high height. Define a rectangle with the Rectangle class inheritance and cube class Box. Two classes in addition to having common attributes length and width, but also has the same interface (public member function) Area (calculated area of a rectangle cube area), Perimeter (calculate rectangular perimeter or circumference cube), Diagmonal (calculated rectangle diagonally lines or cube diagonal length), GetLength (for length attribute), GetWidth (for width attribute), SetLength (set the length attribute) and SetWidth (set the width property). In addition, the cube class Box also need to increase the height property and interface functions Volume (calculated volume of a cube), GetHeight (for height attributes) and SetHeight (set the height property). (No need to consider the constructor)
定义具有继承关系的矩形类Rectangle和立方体类Box。两个类中除了具有共同的属性length和width,还具有相同的接口(公有成员函数)Area(计算矩形面积立方体面积),Perimeter(计算矩形周长或立方体周长),Diagmonal(计算矩形对角线或立方体对角线的长度),GetLength(获取长度属性),GetWidth(获取宽度属性),SetLength(设置长度属性)和SetWidth(设置宽度属性)。除此之外,立方体类Box还需要增加height属性和接口函数Volume(计算立方体的体积),GetHeight(获取高度属性)和SetHeight(设置高度属性)。(不需要考虑构造函数)-Box can be viewed as a cube in a mutually orthogonal rectangle Rectangle long length and width width based on the increase with the length and width one-dimensional orthogonal generated high height. Define a rectangle with the Rectangle class inheritance and cube class Box. Two classes in addition to having common attributes length and width, but also has the same interface (public member function) Area (calculated area of a rectangle cube area), Perimeter (calculate rectangular perimeter or circumference cube), Diagmonal (calculated rectangle diagonally lines or cube diagonal length), GetLength (for length attribute), GetWidth (for width attribute), SetLength (set the length attribute) and SetWidth (set the width property). In addition, the cube class Box also need to increase the height property and interface functions Volume (calculated volume of a cube), GetHeight (for height attributes) and SetHeight (set the height property). (No need to consider the constructor)
(系统自动生成,下载前可以参看下载内容)
下载文件列表
Lab9_2.cpp