文件名称:4_2
介绍说明--下载内容均来自于网络,请自行研究使用
定义一个立方体类,包含的数据成员有立方体的左上角坐标位置和右下角坐标位置,并实现如下要求。
要求: 1)构造函数带入两个三维坐标点位置来初始化成员变量;
2)另一个构造函数带入一个坐标点位置和一个边长来构造一个正方体;
3)一个成员函数求立方体的中心;
4)一个成员函数来获取立方体的体积和表面积;
5)添加静态成员变量统计当前有多少个对象处于生存期,添加静态成员变量表示一个生成过多少个对象;
6)添加静态成员函数获取上面的两个静态成员变量。
7)要有主函数测试所写的功能。-Define a cube class contains data members are left coordinate position and the coordinate position of the lower right corner of the cube, and to achieve the following requirements.
Requirements: 1) into the two-dimensional coordinates constructor to initialize member variables point
2) another constructor into a coordinate position and a side to construct a cube
3) A member function evaluation center of the cube
4) a member function to get the cube of volume and surface area
5) Add a static member variable statistics how many objects are in the current lifetime, add a static member variable represents a generation how many objects
6) Add a static member function to get the above two static member variables.
7) The main function tests have written functions.
要求: 1)构造函数带入两个三维坐标点位置来初始化成员变量;
2)另一个构造函数带入一个坐标点位置和一个边长来构造一个正方体;
3)一个成员函数求立方体的中心;
4)一个成员函数来获取立方体的体积和表面积;
5)添加静态成员变量统计当前有多少个对象处于生存期,添加静态成员变量表示一个生成过多少个对象;
6)添加静态成员函数获取上面的两个静态成员变量。
7)要有主函数测试所写的功能。-Define a cube class contains data members are left coordinate position and the coordinate position of the lower right corner of the cube, and to achieve the following requirements.
Requirements: 1) into the two-dimensional coordinates constructor to initialize member variables point
2) another constructor into a coordinate position and a side to construct a cube
3) A member function evaluation center of the cube
4) a member function to get the cube of volume and surface area
5) Add a static member variable statistics how many objects are in the current lifetime, add a static member variable represents a generation how many objects
6) Add a static member function to get the above two static member variables.
7) The main function tests have written functions.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
4_2.cpp