#include<iostream.h>
class Building
{
public:
Building(){floor=room=0;area=0;}
Building(int f,int r,double a)
{
floor=f;
room=r;
area=a;
}
void Print()const
{
cout<<"The building's specifcation:"<<endl;
cout<<"Floor:"<<"\tRoom:"<<room<<"\tTotal Area:"<<area<<endl;
}
protected:
int floor,room;
double area;
};
class House:public Building
{
public:
House(){bedroom=bathroom=0;}
House(int r,int f,int be,double a,int ba):Building(f,r,a)
{
bedroom=be;
bathroom=ba;
}
void Print()const
{
Building::Print();
cout<<"Include..."<<"\tBedroom:"<<bedroom
<<"tBathroom:"<<bathroom<<endl;
}
private:
int bedroom,bathroom;
};
class Office:public Building
{
public:
Office(){fireExtinguisher=telephone=0;}
Office(int r,int f,double a,int fe,int te):Building(f,r,a)
{
fireExtinguisher=fe;
telephone=te;
}
void Print()const
{
Building::Print();
cout<<"Include..."<<"\tFireExitinguisher:"<<fireExtinguisher
<<"\tTelephone:"<<telephone<<endl;
}
private:
int fireExtinguisher,telephone;
};
void main()
{
House h(3,10,312,45,6,3);
Office o(20,800,22000,200,1400);
h.Print();
o.Print();
}
没有合适的资源?快使用搜索试试~ 我知道了~
c++程序设计经典范例及源代码与实验指导源码
共339个文件
cpp:262个
pdb:13个
pch:10个
需积分: 9 10 下载量 62 浏览量
2009-06-03
08:39:52
上传
评论
收藏 1.77MB RAR 举报
温馨提示
c++程序设计经典范例及源代码与实验指导源码,c++程序设计经典范例及源代码与实验指导源码,c++程序设计经典范例及源代码与实验指导源码。
资源推荐
资源详情
资源评论
收起资源包目录
c++程序设计经典范例及源代码与实验指导源码 (339个子文件)
shiyan11.cpp 5KB
shiyan12.cpp 3KB
shiyan13_1.cpp 3KB
5_5.cpp 2KB
11-9.cpp 2KB
12-7.cpp 2KB
8-18.cpp 2KB
11-8.cpp 2KB
shiyan8_2.cpp 2KB
shiti3_5_1.cpp 2KB
shiyan14.cpp 2KB
4-3.cpp 2KB
13-2.cpp 2KB
shiyan9_2.cpp 2KB
14-8.cpp 2KB
11_1.cpp 2KB
13-9.cpp 2KB
11-6.cpp 2KB
10-6.cpp 2KB
9-6.cpp 2KB
9_3.cpp 1KB
11_2.cpp 1KB
8-5.cpp 1KB
14-11.cpp 1KB
shiti6_5_1.cpp 1KB
13-4.cpp 1KB
13_1.cpp 1KB
6-5.cpp 1KB
13-10.cpp 1KB
8-12.cpp 1KB
shiyan15_2.cpp 1KB
13-8.cpp 1KB
shiti8_5_2.cpp 1KB
shiti7_5_2.cpp 1KB
11_3.cpp 1KB
11-10.cpp 1KB
shiti7_5_1.cpp 1KB
shiyan8_1.cpp 1KB
15-5.cpp 1KB
11-2.cpp 1KB
14-10.cpp 1KB
shiti8_5_1.cpp 1KB
11-4.cpp 1KB
11-7.cpp 1KB
7_1.cpp 1KB
12-4.cpp 1KB
shiti2_4_2.cpp 1KB
shiti3_5_2.cpp 1022B
10-8.cpp 1017B
14_2.cpp 1012B
9-5.cpp 967B
shiti10_5_1.cpp 963B
8_2.cpp 963B
shiti5_5_1.cpp 958B
12-9.cpp 941B
11-5.cpp 932B
9_2.cpp 925B
7-5.cpp 919B
13_3.cpp 909B
8-7.cpp 890B
8_1.cpp 882B
shiti2_5_1.cpp 869B
8-15.cpp 863B
shiyan13_3.cpp 827B
8-8.cpp 826B
shiyan9_1.cpp 811B
14-7.cpp 803B
shiyan13_2.cpp 800B
12_3.cpp 793B
4-6.cpp 790B
11-3.cpp 777B
10_1.cpp 776B
13-7.cpp 760B
5-3.cpp 760B
8-6.cpp 754B
shiyan6_2.CPP 752B
6_4.CPP 749B
12-11.cpp 741B
shiyan6_1.CPP 741B
shiti9_5_2.cpp 737B
8-10.cpp 730B
shiti1_5_2.cpp 729B
14-9.cpp 722B
5-2.cpp 708B
13-12.cpp 704B
Lab15_3.cpp 699B
13-6.cpp 692B
shiyan2_4.CPP 683B
shiti6_5_2.cpp 680B
10_2.cpp 680B
10-5.cpp 675B
4-4.cpp 674B
shiti4_5_2.cpp 672B
shiyan2_3.CPP 659B
15-2.cpp 652B
12-5.cpp 641B
shiyan15_1.cpp 625B
8-4.cpp 613B
15_1.cpp 613B
7-2.cpp 600B
共 339 条
- 1
- 2
- 3
- 4
资源评论
spiderworts
- 粉丝: 52
- 资源: 86
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功