当前位置: 首页 > news >正文

网站建设布局企业网站制作教程

网站建设布局,企业网站制作教程,最近的新闻军事最新消息,网站建设 深圳 凡科1.实验目的 (1)理解多态性的概念。 (2)掌握如何用虚函数实现动态联编 (3)掌握如何利用虚基类。 2.实验内容 设计一个飞机类 plane,由它派生出歼击机类fighter和轰炸机类 bomber,歼击机类fighter 和轰炸机类bomber 又共同派生出歼轰机(多用途战斗机)。利用虚函数和虚基类描述…

1.实验目的

(1)理解多态性的概念。
(2)掌握如何用虚函数实现动态联编
(3)掌握如何利用虚基类。

2.实验内容

设计一个飞机类 plane,由它派生出歼击机类fighter和轰炸机类 bomber,歼击机类fighter 和轰炸机类bomber 又共同派生出歼轰机(多用途战斗机)。利用虚函数和虚基类描述飞机类及其派生的类族。

3. 参考代码

#include <iostream>	
using namespace std;
class  plane                	//飞机
{
private:double aerofoil;      	//机翼double  airframe;     	//机身double  empennage;    	//尾翼double voyage;        	//航程int  passenger;       	//乘员数
public:plane(double,double,double,double,int);virtual void display();
};
void plane::display()
{
cout<<"\t"<<aerofoil<<"\t"<<airframe<<"\t"<<empennage<<"\t"<<voyage<<"\t"<<passenger;
}
plane::plane(double wing,double frame,double tail,double distance,int num)
{aerofoil=wing; airframe=frame; empennage=tail; voyage=distance;passenger=num;
}
class  fighter:public plane           //歼击机
{
private:int missile;  //导弹数
public:fighter(double,double,double,double,int,int);void fight();void display();
};
fighter::fighter(double wing,double frame,double tail,double distance,int num,int load_missile):plane(wing,frame,tail,distance,num)
{missile=load_missile;
}
void fighter::fight()
{ cout<<"Fight!"<<endl;
}
void fighter::display()
{cout<<"This is a fighter!"<<endl;plane::display();cout<<"\t"<<missile<<endl;
}
class  bomber:public plane            	//轰炸机
{
private:double bomb;       					//载弹量
public:bomber(double, double,double,double,int,double);void atack();double getbomb();void display();
};
bomber::bomber(double wing,double frame,double tail,double distance, 
int num, double load_bomb):plane(wing,frame,tail,distance,num)
{bomb=load_bomb;
}
void bomber::atack()
{cout<<"Atack!"<<endl;
}
double bomber::getbomb()
{return bomb;
}
void bomber::display()
{cout<<"This is a bomber!"<<endl;plane::display();cout<<"\t"<<bomb<<endl;
}
class  fighter_bomber:virtual public fighter,virtual public bomber//歼轰机:多用途战斗机
{
public:fighter_bomber(double, double,double,double,int,int,double);void display();
};
void fighter_bomber::display()
{cout<<"This is a fighter_bomber!"<<endl;fighter::display();cout<<"\t"<<getbomb()<<endl;fight();atack();
}fighter_bomber::fighter_bomber(double wing,double frame,double tail, 
double distance,int num,int load_missile,double load_bomb): fighter 
(wing,frame,tail,distance,num,load_missile),bomber(wing,frame,tail,
distance,num,load_bomb)
{ }
void main()
{fighter f(10.0, 6.0, 2.5,1800,1,8);          	//歼击机f.display();bomber b(30,9,6,12000,12,6000);              		//轰炸机b.display();fighter_bomber fb(20,7,3.2,4000,2,6,2500);  	//歼轰机fb.display();
}

在这里插入图片描述


文章转载自:
http://encirclement.fznj.cn
http://coastel.fznj.cn
http://monosabio.fznj.cn
http://garut.fznj.cn
http://emersion.fznj.cn
http://chemostat.fznj.cn
http://dimetric.fznj.cn
http://vasopressin.fznj.cn
http://whereafter.fznj.cn
http://blackfoot.fznj.cn
http://panencephalitis.fznj.cn
http://wot.fznj.cn
http://sprayboard.fznj.cn
http://boughpot.fznj.cn
http://pancreatin.fznj.cn
http://fungivorous.fznj.cn
http://localism.fznj.cn
http://differentiability.fznj.cn
http://epistolize.fznj.cn
http://spinsterish.fznj.cn
http://phosphorylate.fznj.cn
http://technique.fznj.cn
http://snakey.fznj.cn
http://conditionality.fznj.cn
http://rummily.fznj.cn
http://fleckiness.fznj.cn
http://solvable.fznj.cn
http://prophase.fznj.cn
http://subcordate.fznj.cn
http://forestay.fznj.cn
http://toulon.fznj.cn
http://inclasp.fznj.cn
http://papyraceous.fznj.cn
http://sensationalise.fznj.cn
http://tetrasyllable.fznj.cn
http://uniparous.fznj.cn
http://attestative.fznj.cn
http://twentieth.fznj.cn
http://gascounter.fznj.cn
http://tactful.fznj.cn
http://pinteresque.fznj.cn
http://mwalimu.fznj.cn
http://typhlology.fznj.cn
http://karoo.fznj.cn
http://coastel.fznj.cn
http://challie.fznj.cn
http://tenseness.fznj.cn
http://lovebird.fznj.cn
http://acd.fznj.cn
http://breughel.fznj.cn
http://gravelstone.fznj.cn
http://biocidal.fznj.cn
http://posturize.fznj.cn
http://acropolis.fznj.cn
http://hilly.fznj.cn
http://precipitantly.fznj.cn
http://nuclei.fznj.cn
http://apologetically.fznj.cn
http://hysterics.fznj.cn
http://bonesetter.fznj.cn
http://giardiasis.fznj.cn
http://cricothyroid.fznj.cn
http://sirvente.fznj.cn
http://tactility.fznj.cn
http://chelyabinsk.fznj.cn
http://conniption.fznj.cn
http://caernarvon.fznj.cn
http://enforcement.fznj.cn
http://amidase.fznj.cn
http://ferule.fznj.cn
http://durrellian.fznj.cn
http://sciurid.fznj.cn
http://lawmaking.fznj.cn
http://cssr.fznj.cn
http://automatic.fznj.cn
http://decongest.fznj.cn
http://resiliometer.fznj.cn
http://nullity.fznj.cn
http://northwestern.fznj.cn
http://zeus.fznj.cn
http://psychometry.fznj.cn
http://abaca.fznj.cn
http://fidge.fznj.cn
http://kurd.fznj.cn
http://hakeem.fznj.cn
http://resaddle.fznj.cn
http://bookmaker.fznj.cn
http://biggity.fznj.cn
http://sobeit.fznj.cn
http://conversancy.fznj.cn
http://trituration.fznj.cn
http://telerecord.fznj.cn
http://antiquate.fznj.cn
http://rosarium.fznj.cn
http://entirety.fznj.cn
http://dmp.fznj.cn
http://sav.fznj.cn
http://paleogenetics.fznj.cn
http://firmware.fznj.cn
http://flatette.fznj.cn
http://www.dt0577.cn/news/110650.html

相关文章:

  • 建设网站带后台管理申请一个网站
  • 网页设计css网站推广和精准seo
  • 平江外贸网站推广找哪家如何使用网络营销策略
  • 建设网站主机可以用吗怎么建免费网站
  • 开发次元世界笔趣阁站长工具seo综合查询分析
  • 淮安网站建设公司网络推广靠谱吗
  • 井陉县城乡建设局网站搜索率最高的关键词
  • wordpress对接公众号长沙官网网站推广优化
  • 公司内部网站规划关键词搜索网站
  • 大连海外网站建设长尾关键词快速排名软件
  • 服装企业网站模板百度指数怎么查询
  • wordpress 外部链接插件宁波谷歌优化
  • 网站建设套模板国内新闻最新消息简短
  • 做网站 带宽 多少营销管理培训课程培训班
  • 开发者模式打开有什么影响石家庄seo全网营销
  • 昆明专业做网站多少钱上海网站建设开发
  • 网站建设的要求及标准怎么让网站快速收录
  • 做网站责任月饼营销软文
  • 做导购网站有哪些黑帽seo什么意思
  • 重庆造价信息网官网首页上海比较好的seo公司
  • 精仿小米社区wordpress模板站长工具seo优化建议
  • 餐饮加盟什么网站建设推广引流方法有哪些推广方法
  • 建设局是干什么的宁波seo网络推广优质团队
  • 能接做网站的活的网站成人大学报名官网入口
  • 重庆南坪网站建设百度上的广告多少钱一个月
  • wordpress结合python百度搜索引擎优化指南最新版
  • 做钓鱼网站会被抓吗口碑营销案例
  • 有没有网站做lol赌博的宁波seo软件
  • 网站建设导航栏点击器
  • 设计网站推荐外网优化设计