第二章第6题
来源:互联网 发布:手机视频加密软件 编辑:程序博客网 时间:2024/04/29 13:47
#include <iostream>using namespace std;class Box{public: void get_value(); float volume(); void display(); public: float lengh; float width; float height; };void Box::get_value(){ cout<<"please input lengh, width,height:"; cin>>lengh; cin>>width; cin>>height;}float Box::volume(){ return(lengh*width*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;}
0 0
- 第二章第6题
- 第二章第6题
- 第二章第6题
- 《C++编程》第二章第6题
- 第二章第1题
- 第二章第4题
- 第二章第3题
- 第二章第10题
- 第二章第12题
- 第二章第13题
- 第二章第16题
- 第二章第14题
- 第二章第15题
- 第二章第17题
- 第二章第18题
- 第二章第19题
- 第二章第20题
- 第二章第2题
- matlab取方格周长(注释版)
- 自定义WritableComparable遭遇空指针异常的一个场景
- CentOS7 安装使用Remmina(Remote desktop client)
- C/C++参数(默认参数、占位符参数)
- java的File类
- 第二章第6题
- Android 模拟器失去连接的解决方案
- Android源码分析—带你认识不一样的AsyncTask
- 康拓展开
- jstl - 之<c:forEach>
- 无搏,何以赛
- linux下安装vsftp
- 08-自定义filter
- oracle导出空表解决方案