纠错
全专业资料、题库、学位、网课
最高直省2344元
上千+科次精品网课
买网课即送全真模考题库
五千+科次教材资料
电子资料满三件9折
五千+科次在线题库
全真呈现历年考试试题
1、[主观题]仔细阅读下面的程序,找出类定义中的错误及其理由,并以尽量少的改动写出test的定义,使其能够正确编译运行并给出运行结果。#includeclasstest{intm;intGet{returnm;}public:statictest(inti){m=i;}voidSet(inti){m=i;}voidShow{cout
2、[主观题]对虚函数使用基类类型的指针或引用调用,系统使用___联编;而使用对象调用时,系统使用___联编。
3、[主观题]在下面程序中的横线处填上适当内容,使程序完整。#includeclassvehicle{protected:intsize;intspeed;public:voidsetSpeed(ints){speed=s;}①___getSpeedLevel{returnspeed/10;}};classcar:pubicvehicle{public:intgetSpeedLeve{returnspeed/5;}};classtruck:publicvehicle{public:intgetSpeedLevel{returnspeed/15;}};intmaxSpeedLevel(vehicle②___,vehicle③___){if(v1.getSpeedLevel>v2.getSpeedLevel)return1;elsereturn2;}voidmain{truckt;carc;t.setSpeed;c.setSpeed;cout
4、[主观题]找出下面程序中的错误,并改正#includeclassTest{private:staticintx;public:virtualstaticintfunc;};intTest::x=20;intTest::func{returnx;}voidmain{cout
5、[主观题]关键字private、public、protected以后的成员的访问权限分别是___、___和___。如果没有使用关键字,则所有成员缺省定义为___权限。
Copyright © 2010 - 2023 湖南求实创新教育科技有限公司 All Right Reserved.
温馨提示:如您需要的资料本网暂时没有,请于工作日08:00-18:00,点击这里,联系客服及时补充资料。