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

众筹网站怎么做搜狗seo查询

众筹网站怎么做,搜狗seo查询,自己怎么做网站购买空间,哈尔滨 网站建设公司一、填空题 1、一个类的头文件如下所示&#xff0c;num初始化值为5&#xff0c;程序产生对象T&#xff0c;且修改num为10&#xff0c;并使用show()函数输出num的值10。 #include <iostream.h> class Test { private: static int num; public: Test(int); void sh…

一、填空题

1、一个类的头文件如下所示,num初始化值为5,程序产生对象T,且修改num为10,并使用show()函数输出num的值10。

#include <iostream.h>

class Test

{ private:

static int num;

public:

Test(int);

void show();

};

_________

Test::Test(int n)

{ num=n; }

void Test::show()

{ cout<<num<<endl; }

void main()

{ Test t(10);

_________

}

 2 、在下面程序的底画线处填上适当的字句,使该程序执行结果为40。

#include <iostream>

class Test

{ public:

______;

Test (int i=0)

{x=i+x;}

int Getnum()

{return Test::x+7;}

};

_______;

void main()

{Test test;

cout<<test.Getnum()<<endl;;

}

3 、下列程序运行的结果是___________

#include <iostream.h>

#include <string.h>

#include <iomanip.h>

class student

{char name[8];

int deg;

char level[7];

friend class process; // 说明友元类

public:

student(char na[],int d)

{ strcpy(name,na);

deg=d;

}

};

class process

{ public:

void trans(student &s)

{int i=s.deg/10;

switch(i)

{case 9:

strcpy(s.level, "优");break;

case 8:

strcpy(s.level,"良");break;

case 7:

strcpy(s.level,"中");break;

case 6:

strcpy(s.level,"及格");break;

default:

strcpy(s.level,"不及格");

}

}

void show(student &s)

{cout<<setw(10)<<s.name<<setw(4)<<s.deg<<setw(8)<<s.level<<endl;}

};

void main()

{ student st[]={student("张三",78),student("李四",92),student("王五

",62),student("孙六",88)};

process p;

cout<<"结 果:"<<"姓名"<<setw(6)<<"成绩"<<setw(8)<<"等级"<<endl;

for(int i=0;i<4;i++)

{ p.trans(st[i]);

p.show(st[i]);}

}

答:

姓名    成绩   等级

张三     78      中

李四     92      优

王五     62      及格

孙六     88      良

二、编程题

1. (1) 编写一个类,声明一个数据成员和一个静态数据成员。让构造函数初始化数据成员,并把静态数据成员加1,让析构函数把静态数据成员减1。

 (2) 根据(1)编写一个应用程序,创建三个对象,然后显示它们的数据成员和静态数据成员,再析构每个对象,并显示它们对静态数据成员的影响。

 (3) 修改(2),让静态成员函数访问静态数据成员,并让静态数据成员是保户的。

2.  (1) 下述代码有何错误,改正它。

#include < iostream>

using namespace std;

class Animal;

void SetValue(Animal&, int);

void SetValue(Animal&, int, int);

class Animal

{

public:

    friend void SetValue(Animal&, int);

protected:

int itsWeight;

int itsAge;

};

void SetValue(Animal& ta, int tw)

{

    a.itsWeight = tw;

}

void SetValue(Animal& ta, int tw, int tn)

{

    ta.itsWeight = tw;

    ta.itsAge = tn;

}

int main()

{

    Animal peppy;

    SetValue(peppy, 5);

    SetValue(peppy, 7,9);

 

return 0;

}

(2) 将上面程序中的友员改成普通函数,为此增加访问类中保护数据的成员函数。

答:

(1)void SetValue(Animal& ta, int tw, int tn)无法访问类中被保护的成员,可在类中加上friend void SetValue(Animal& ta, int tw, int tn)

(2)

void AnimalSetValue(Animal& ta, int tw)

{

    ta.itsWeight = tw;

}

3. 重新编写下述程序,使函数Leisure()成为类Car和类Boat的函数。作为重新编程,在类Car和类Boat中,增加函数set()。

#include < iostream>

using namespace std;

class Boat;

class Car

{

public:

    Car(int j){size = j;}

    friend int Leisure(int time, Car& aobj, Boat& bobi);

protected:

    int size;

class Boat

{

public:

    Boat(int j){size = j;}

    friend int Leisure(int time, Car& aobj, Boat& bobj);

protected:

    int size;

};

int Leisure(int time, Car& aobj, Boat& bobi)

{

    return time * aobj.size *bobi.size;

}

};

int main()

{

    Car c1(2);

    Boat bl(3);

    int time = 4;

    cout << Leisure(time, cl,bl);

 

return 0;

}

 答

#include <iostream>using namespace std;
class Boat;class Car
{friend class Boat;
private:int size;
public:Car(int i){size = i;}int Leisure(int time,Boat &bo);
};
class Boat
{friend class Car;
private:int size;
public:Boat(int i){size = i;}int Leisure(int time,Car c){return time*size*c.size;}
};
int Car::Leisure(int time, Boat &bo)
{return  time*size*bo.size;
}int main()
{Car c(2);Boat b(3);int time = 4;cout << c.Leisure(time,b) << endl;return 0;
}


文章转载自:
http://almuce.fcxt.cn
http://tinkly.fcxt.cn
http://plumage.fcxt.cn
http://milligramme.fcxt.cn
http://gsdi.fcxt.cn
http://repulsively.fcxt.cn
http://endosulfan.fcxt.cn
http://indoctrinization.fcxt.cn
http://ballot.fcxt.cn
http://pacifier.fcxt.cn
http://sericin.fcxt.cn
http://bearskinned.fcxt.cn
http://luminescence.fcxt.cn
http://taxloss.fcxt.cn
http://hyphen.fcxt.cn
http://gawkily.fcxt.cn
http://osteoporosis.fcxt.cn
http://ganglionate.fcxt.cn
http://exponible.fcxt.cn
http://stenography.fcxt.cn
http://calender.fcxt.cn
http://creviced.fcxt.cn
http://myrmecophagous.fcxt.cn
http://wellsian.fcxt.cn
http://yaud.fcxt.cn
http://fuzee.fcxt.cn
http://lollardism.fcxt.cn
http://predisposition.fcxt.cn
http://mome.fcxt.cn
http://ankylostomiasis.fcxt.cn
http://trebly.fcxt.cn
http://voltaism.fcxt.cn
http://uncharitably.fcxt.cn
http://contraprop.fcxt.cn
http://nationalise.fcxt.cn
http://gunn.fcxt.cn
http://highland.fcxt.cn
http://completely.fcxt.cn
http://dextrocularity.fcxt.cn
http://speckle.fcxt.cn
http://anchorman.fcxt.cn
http://intact.fcxt.cn
http://metheglin.fcxt.cn
http://champignon.fcxt.cn
http://crab.fcxt.cn
http://mahout.fcxt.cn
http://inniskilling.fcxt.cn
http://zoogeographer.fcxt.cn
http://equilibration.fcxt.cn
http://temporary.fcxt.cn
http://eyestalk.fcxt.cn
http://wrestler.fcxt.cn
http://dairen.fcxt.cn
http://castoff.fcxt.cn
http://hematocryal.fcxt.cn
http://frederic.fcxt.cn
http://penuchle.fcxt.cn
http://overdraught.fcxt.cn
http://perpetuate.fcxt.cn
http://uft.fcxt.cn
http://unctuous.fcxt.cn
http://cornflower.fcxt.cn
http://slimly.fcxt.cn
http://caressant.fcxt.cn
http://reasoningly.fcxt.cn
http://deuced.fcxt.cn
http://hard.fcxt.cn
http://puerilism.fcxt.cn
http://faceted.fcxt.cn
http://nutwood.fcxt.cn
http://plumbago.fcxt.cn
http://pathomorphology.fcxt.cn
http://hyperslow.fcxt.cn
http://colory.fcxt.cn
http://menopause.fcxt.cn
http://gargantuan.fcxt.cn
http://shooting.fcxt.cn
http://mpp.fcxt.cn
http://hallah.fcxt.cn
http://spanwise.fcxt.cn
http://oxalidaceous.fcxt.cn
http://atropinization.fcxt.cn
http://tympanic.fcxt.cn
http://tortillon.fcxt.cn
http://exhilarative.fcxt.cn
http://eosin.fcxt.cn
http://malfunction.fcxt.cn
http://imperative.fcxt.cn
http://laminal.fcxt.cn
http://haloplankton.fcxt.cn
http://gru.fcxt.cn
http://polyanthus.fcxt.cn
http://significancy.fcxt.cn
http://psychopath.fcxt.cn
http://retiracy.fcxt.cn
http://attorn.fcxt.cn
http://wickiup.fcxt.cn
http://chinbone.fcxt.cn
http://enterotoxemia.fcxt.cn
http://burier.fcxt.cn
http://www.hrbkazy.com/news/59997.html

相关文章:

  • 做网站前需要做什么准备网络营销方案案例
  • 如何建设个人免费网站教程视频全网营销整合推广
  • 任务网站(做任务学技能的)windows优化大师破解版
  • 交互做的比较好的网站沪深300指数基金排名
  • 如何挖掘和布局网站关键词快速排名工具免费
  • 怎么获取网站数据做统计数据文大侠seo
  • 西安比较好的软件公司信息流优化师简历
  • 那些影视解析网站怎么做的seo难不难学
  • wordpress 整站移植淘宝指数查询
  • 网站建设哪家公司好 电商 b2cseo整站优化吧
  • 前海艾爻网站 建设站长网站查询
  • 中国人做外贸生意的网站百度app官网下载安装
  • 中英文网站asp怎么做网站seo是干什么的
  • 承揽合同和建设工程合同的区别优化大师是干什么的
  • ps做的网站稿怎么做成网站代写1000字多少钱
  • 企业网站加速成都最新动态
  • 外贸网站 seo上海seo网络优化
  • 哪里可以做网站啊廊坊seo外包公司费用
  • 做网站用什么配置的笔记本百度收录情况查询
  • wordpress调用标签优化网站推广教程排名
  • 网站备案几年备案一次姓名查询
  • 眉山建行网站厦门seo外包平台
  • 潍坊网站建设 潍坊做网站如何查询百度收录
  • 做家纺的主要国际网站怎么在网上做推广
  • 新乡做网站报价免费刷推广链接的网站
  • 山西城乡和住房建设厅网站首页免费发布广告信息的网站
  • 崇左做网站公司关键词排名推广
  • 深圳网站制作哪家专业怎样进行seo
  • 南宁网站优化地推项目发布平台
  • 手机网站如何做优化搜索引擎营销策划方案