有大佬帮忙吗?刚学的小白
c吧
全部回复
仅看楼主
level 1
1,、读程序,回答下面问题:
#include <iostream>
using namespace std;
class Box
{public:
voidget_value()
{
}
floatvolume();
voiddisplay();
public:
float lengh;
float width;
float height;
};
void Box::display()
{ cout<<volume()<<endl;}
int main()
{Box box1,box2,box3;
box1.get_value();
cout<<"volmue of bax1 is ";
box1.display();
box2.get_value();
cout<<"volmue of bax2 is ";
box2.display();
box3.get_value();
cout<<"volmue of bax3 is ";
box3.display();
return 0;
}
(1) 将get_value()函数数补充完整;
(2) 添加计算长方体体积的成员函数;
(3) 输出程序运行结果。
2017年12月26日 07点12分 1
1